0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-03-13 04:53:21 +00:00

Merge remote-tracking branch 'upstream/hotfix' into combined_language_file_update_2

# Conflicts:
#	modules/Administration/language/en_us.lang.php
#	modules/Calendar/language/en_us.lang.php
#	modules/Configurator/language/en_us.lang.php
#	modules/Studio/language/en_us.Portal.html
This commit is contained in:
Dillon Brown 2017-07-14 10:38:05 +01:00
commit 2c0c899e0a
296 changed files with 11956 additions and 7480 deletions
.travis.ymlCODE_OF_CONDUCT.mdREADME.md
custom/blowfish
data
include
install
jssource/src_files
modules
ACL/language
ACLActions/language
ACLRoles/language
AM_ProjectTemplates/language
AM_TaskTemplates/language
AOBH_BusinessHours/language
AOD_Index/language
AOD_IndexEvent/language
AOK_KnowledgeBase/language
AOK_Knowledge_Base_Categories/language
AOP_Case_Events/language
AOP_Case_Updates/language
AOR_Charts/language
AOR_Conditions/language
AOR_Fields/language
AOR_Reports/language
AOR_Scheduled_Reports/language
AOS_Contracts/language
AOS_Invoices/language
AOS_Line_Item_Groups/language
AOS_PDF_Templates
AOS_Product_Categories/language
AOS_Products/language
AOS_Products_Quotes/language
AOS_Quotes
AOW_Actions/language
AOW_Conditions/language
AOW_Processed/language
AOW_WorkFlow/language

View file

@ -25,3 +25,4 @@ branches:
- hotfix
- develop
- /feature.*/
- /fix.*/

35
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,35 @@
# Code of Conduct #
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
Examples of behaviour that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community in a professional manner
* Showing empathy towards other community members
Examples of unacceptable behaviour by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
The SuiteCRM project maintainers are responsible for clarifying the standards of acceptable behaviour and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behaviour. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
The SuiteCRM project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviours that they deem inappropriate, threatening, offensive, or harmful.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, within project forums, posting via an official social media account, or acting as an appointed representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behaviour may be reported by contacting the project team at [community@suitecrm.com][community_email]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[community_email]: mailto:community@suitecrm.com
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View file

@ -1,4 +1,4 @@
## SuiteCRM 7.9.0
## SuiteCRM 7.9.1
[![Build Status](https://travis-ci.org/salesagility/SuiteCRM.svg?branch=hotfix)](https://travis-ci.org/salesagility/SuiteCRM)
@ -11,6 +11,16 @@ This repository has been created to allow community members to collaborate and c
### Contributing to the project ###
#### Security ####
We take Security seriously here at SuiteCRM so if you have discovered a security risk report it by
emailing security@suitecrm.com. This will be delivered to the product team who handle security issues.
Please don't disclose security bugs publicly until they have been handled by the security team.
Your email will be acknowledged within 24 hours during the business week (Mon - Fri), and youll receive a more
detailed response to your email within 72 hours during the business week (Mon - Fri) indicating the next steps in
handling your report.
##### Important: Please read before developing code intended for inclusion in the SuiteCRM project. #####
Please read and sign the following [contributor agreement][cont_agrmt]
@ -21,6 +31,12 @@ The Contributor Agreement only needs to be signed once for all pull requests and
Once signed and confirmed, any pull requests will be considered for inclusion in the SuiteCRM project.
### Code of Conduct ###
See our [Code of Conduct][code_of_conduct] on our Wiki.
[code_of_conduct]: https://suitecrm.com/wiki/index.php/Contributing_to_SuiteCRM#Code_of_Conduct
### Helpful links for the community ###
The following links offer various ways to view, contribute and collaborate to the SuiteCRM project:
@ -40,10 +56,14 @@ The following links offer various ways to view, contribute and collaborate to th
### Development Roadmap ###
[ View the Roadmap here and get involved][suitecrm_roadmap]
[ View the Community Roadmap here and get involved][suitecrm_roadmap]
[suitecrm_roadmap]: https://suitecrm.com/community/roadmap
[More detailed SuiteCRM Community LTS Roadmap][suitecrm_detailed_roadmap]
[suitecrm_detailed_roadmap]: https://suitecrm.com/lts/
### Support & Licensing ###
SuiteCRM is an open source project. As such please do not contact us directly via email or phone for SuiteCRM support. Instead please use our support forum. By using the forum the knowledge is shared with everyone in the community. Our developers answer questions on the forum daily but it also gives the other members of the community the opportunity to contribute. If you would like customisations to specifically fit your SuiteCRM needs then please use our contact form.

View file

@ -1,5 +0,0 @@
<?php
// created: 2014-01-16 22:17:01
$key = array (
0 => '4e729a53-db37-ba0e-b5ae-52d85aa63ba9',
);

View file

@ -122,7 +122,7 @@ class Link2
if (!$this->loadedSuccesfully()) {
$logFunction = 'fatal';
if (!isset($this->def['source']) || $this->def['source'] !== 'non-db') {
if (!isset($this->def['source']) || $this->def['source'] === 'non-db') {
$logFunction = 'warn';
}
$GLOBALS['log']->$logFunction("{$this->name} for {$this->def['relationship']} failed to load\n");

View file

@ -2093,9 +2093,8 @@ class SugarBean
if ($def['type'] == 'html' || $def['type'] == 'longhtml') {
$this->$key = SugarCleaner::cleanHtml($this->$key, true);
} elseif ((strpos($type, 'char') !== false ||
strpos($type, 'text') !== false ||
$type == 'enum') &&
} elseif (
(strpos($type, 'char') !== false || strpos($type, 'text') !== false || $type == 'enum') &&
!empty($this->$key)
) {
$this->$key = SugarCleaner::cleanHtml($this->$key);
@ -2507,7 +2506,7 @@ class SugarBean
}
} else {
$logFunction = 'fatal';
if (isset($this->field_defs[$linkField]['source']) && $this->field_defs[$linkField]['source'] !== 'non-db') {
if (isset($this->field_defs[$linkField]['source']) && $this->field_defs[$linkField]['source'] === 'non-db') {
$logFunction = 'warn';
}
$GLOBALS['log']->$logFunction("Failed to load relationship {$linkField} while saving {$this->module_dir}");
@ -4547,7 +4546,7 @@ class SugarBean
* @param string $where where clause. defaults to ""
* @param bool $check_dates . defaults to false
* @param int $show_deleted show deleted records. defaults to 0
* @return SugarBean[]
* @return null|SugarBean[]
*/
public function get_full_list($order_by = "", $where = "", $check_dates = false, $show_deleted = 0)
{
@ -4565,7 +4564,7 @@ class SugarBean
* Internal function, do not override.
* @param string $query query to be processed.
* @param bool $check_date Optional, default false. if set to true date time values are processed.
* @return array Fetched data.
* @return null|array Fetched data.
*
*/
public function process_full_list_query($query, $check_date = false)

View file

@ -242,7 +242,13 @@ class Dashlet
$template->assign('CONFIGURE_ICON', $this->setConfigureIcon());
$template->assign('REFRESH_ICON', $this->setRefreshIcon());
$template->assign('DELETE_ICON',$this->setDeleteIcon());
$template->assign('DASHLET_MODULE',$this->seedBean->module_name);
$moduleName = '';
if(!is_object($this->seedBean)) {
$GLOBALS['log']->warn('incorrect seed bean');
} else {
$moduleName = $this->seedBean->module_name;
}
$template->assign('DASHLET_MODULE', $moduleName);
$template->assign('DASHLET_BUTTON_ARIA_EDIT', translate('LBL_DASHLET_EDIT', 'Home'));
$template->assign('DASHLET_BUTTON_ARIA_REFRESH', translate('LBL_DASHLET_REFRESH', 'Home'));
$template->assign('DASHLET_BUTTON_ARIA_DELETE', translate('LBL_DASHLET_DELETE', 'Home'));

View file

@ -97,6 +97,16 @@ class EditView
*/
public $returnModule;
/**
* @var string $returnRelationship
*/
public $returnRelationship;
/**
* @var string $returnRelationship
*/
public $returnName;
/**
* @var string $returnId UUID
*/
@ -197,13 +207,12 @@ class EditView
* This is the EditView constructor responsible for processing the new
* Meta-Data framework
*
* @param $module String value of module this Edit view is for
* @param $focus An empty sugarbean object of module
* @param $id The record id to retrieve and populate data for
* @param $metadataFile String value of file location to use in overriding default metadata file
* @param tpl String value of file location to use in overriding default Smarty template
* @param createFocus bool value to tell whether to create a new bean if we do not have one with an id, this is used from ConvertLead
* @param $metadataFileName specifies the name of the metadata file eg 'editviewdefs'
* @param string $module value of module this Edit view is for
* @param SugarBean $focus An empty sugarbean object of module
* @param string $metadataFile value of file location to use in overriding default metadata file
* @param string $tpl value of file location to use in overriding default Smarty template
* @param bool $createFocus value to tell whether to create a new bean if we do not have one with an id, this is used from ConvertLead
* @param string $metadataFileName specifies the name of the metadata file eg 'editviewdefs'
*
*/
public function setup(
@ -257,11 +266,11 @@ class EditView
fclose($fp);
}
//Flag an error... we couldn't create the best guess meta-data file
// Flag an error... we couldn't create the best guess meta-data file
if (!file_exists("modules/$this->module/metadata/$metadataFileName.php")) {
global $app_strings;
$error = str_replace("[file]", "modules/$this->module/metadata/$metadataFileName.php",
$error = str_replace('[file]', "modules/$this->module/metadata/$metadataFileName.php",
$app_strings['ERR_CANNOT_CREATE_METADATA_FILE']);
$GLOBALS['log']->fatal($error);
echo $error;
@ -272,7 +281,9 @@ class EditView
}
$this->defs = $viewdefs[$this->module][$this->view];
$this->isDuplicate = isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true' && $this->focus->aclAccess('edit');
$this->isDuplicate = isset($_REQUEST['isDuplicate']) &&
$_REQUEST['isDuplicate'] === 'true' &&
$this->focus->ACLAccess('edit');
}
public function createFocus()
@ -306,24 +317,24 @@ class EditView
*/
public function populateBean($request = array())
{
if(empty($request) && isset($_REQUEST) && !empty($_REQUEST)) {
if (empty($request) && isset($_REQUEST) && !empty($_REQUEST)) {
$request = $_REQUEST;
}
if (
$this->populateBean &&
isset($request['record']) &&
!empty($request['record']) &&
isset($request['module']) &&
!empty($request['module']) &&
$this->populateBean
!empty($request['module'])
) {
global $beanList;
$bean = $beanList[ $request['module'] ];
$bean = $beanList[$request['module']];
$obj = new $bean();
$this->focus = $obj->retrieve($request['record']);
} else {
$GLOBALS['log']->debug("Unable to populate bean, no record and no module parameter found");
$GLOBALS['log']->debug('Unable to populate bean, no record and no module parameter found');
}
}
@ -348,7 +359,7 @@ class EditView
foreach ($this->defs['panels'] as $key => $p) {
foreach ($p as $row => $rowDef) {
foreach ($rowDef as $col => $colDef) {
$field = (is_array($p[$row][$col])) ? $p[$row][$col]['name'] : $p[$row][$col];
$field = is_array($p[$row][$col]) ? $p[$row][$col]['name'] : $p[$row][$col];
if ((!empty($this->focus->field_defs[$field])
&& !empty($this->focus->field_defs[$field]['required']))
|| (!empty($p[$row][$col]['displayParams']['required']))
@ -397,7 +408,7 @@ class EditView
}
}
if ($this->view == 'EditView' && !empty($GLOBALS['sugar_config']['forms']['requireFirst'])) {
if ($this->view === 'EditView' && !empty($GLOBALS['sugar_config']['forms']['requireFirst'])) {
$this->requiredFirst();
}
@ -486,9 +497,13 @@ class EditView
return $panel;
}
/**
* @param bool $checkFormName
* @param string $formName
*/
public function process($checkFormName = false, $formName = '')
{
global $mod_strings, $sugar_config, $app_strings, $app_list_strings;
global $app_list_strings;
//the retrieve already did this work;
//$this->focus->fill_in_relationship_fields();
@ -509,24 +524,33 @@ class EditView
}
if ($this->showVCRControl) {
$this->th->ss->assign('PAGINATION',
SugarVCR::menu($this->module, $this->offset, $this->focus->is_AuditEnabled(),
($this->view == 'EditView')));
$this->th->ss->assign(
'PAGINATION',
SugarVCR::menu(
$this->module,
$this->offset, $this->focus->is_AuditEnabled(),
$this->view === 'EditView'
)
);
$this->th->ss->assign('showVCRControl', $this->showVCRControl);
}
if (isset($_REQUEST['return_module'])) {
$this->returnModule = $_REQUEST['return_module'];
}
if (isset($_REQUEST['return_action'])) {
$this->returnAction = $_REQUEST['return_action'];
}
if (isset($_REQUEST['return_id'])) {
$this->returnId = $_REQUEST['return_id'];
}
if (isset($_REQUEST['return_relationship'])) {
$this->returnRelationship = $_REQUEST['return_relationship'];
}
if (isset($_REQUEST['return_name'])) {
$this->returnName = $this->getValueFromRequest($_REQUEST, 'return_name');
}
@ -546,13 +570,13 @@ class EditView
$this->focus->assigned_user_name = get_assigned_user_name($this->focus->assigned_user_id);
}
// TODO: TASK: UNDEFINED - move into Scheduler
if (!empty($this->focus->job) && $this->focus->job_function == '') {
$this->focus->job_function = $this->focus->job;
}
foreach ($this->focus->toArray() as $name => $value) {
$valueFormatted = false;
//if ($this->focus->field_defs[$name]['type']=='link')continue;
$this->fieldDefs[$name] = (!empty($this->fieldDefs[$name]) && !empty($this->fieldDefs[$name]['value']))
? array_merge($this->focus->field_defs[$name], $this->fieldDefs[$name])
@ -565,20 +589,38 @@ class EditView
}
}
if (isset($this->fieldDefs[$name]['options']) && isset($app_list_strings[$this->fieldDefs[$name]['options']])) {
if (isset($GLOBALS['sugar_config']['enable_autocomplete']) && $GLOBALS['sugar_config']['enable_autocomplete'] == true) {
if (
isset($this->fieldDefs[$name]['options']) &&
isset($app_list_strings[$this->fieldDefs[$name]['options']])
) {
if (
isset($GLOBALS['sugar_config']['enable_autocomplete']) &&
$GLOBALS['sugar_config']['enable_autocomplete'] == true
) {
$this->fieldDefs[$name]['autocomplete'] = true;
$this->fieldDefs[$name]['autocomplete_options'] = $this->fieldDefs[$name]['options']; // we need the name for autocomplete
// we need the name for autocomplete
$this->fieldDefs[$name]['autocomplete_options'] = $this->fieldDefs[$name]['options'];
} else {
$this->fieldDefs[$name]['autocomplete'] = false;
}
// Bug 57472 - $this->fieldDefs[$name]['autocomplete_options' was set too late, it didn't retrieve the list's name, but the list itself (the developper comment show us that developper expected to retrieve list's name and not the options array)
// Bug 57472 - $this->fieldDefs[$name]['autocomplete_options' was set too late, it didn't retrieve
// the list's name, but the list itself (the developper comment show us that developper expected to
// retrieve list's name and not the options array)
$this->fieldDefs[$name]['options'] = $app_list_strings[$this->fieldDefs[$name]['options']];
}
if (isset($this->fieldDefs[$name]['options']) && is_array($this->fieldDefs[$name]['options']) && isset($this->fieldDefs[$name]['default_empty']) && !isset($this->fieldDefs[$name]['options'][$this->fieldDefs[$name]['default_empty']])) {
$this->fieldDefs[$name]['options'] = array_merge(array($this->fieldDefs[$name]['default_empty'] => $this->fieldDefs[$name]['default_empty']),
$this->fieldDefs[$name]['options']);
if (
isset($this->fieldDefs[$name]['options']) &&
is_array($this->fieldDefs[$name]['options']) &&
isset($this->fieldDefs[$name]['default_empty']) &&
!isset($this->fieldDefs[$name]['options'][$this->fieldDefs[$name]['default_empty']])
) {
$this->fieldDefs[$name]['options'] = array_merge(
array(
$this->fieldDefs[$name]['default_empty'] => $this->fieldDefs[$name]['default_empty']
),
$this->fieldDefs[$name]['options']
);
}
if (isset($this->fieldDefs[$name]['function'])) {
@ -589,23 +631,37 @@ class EditView
$function = $this->fieldDefs[$name]['function'];
}
if (isset($this->fieldDefs[$name]['function']['include']) && file_exists($this->fieldDefs[$name]['function']['include'])) {
if (
isset($this->fieldDefs[$name]['function']['include']) &&
file_exists($this->fieldDefs[$name]['function']['include'])
) {
require_once($this->fieldDefs[$name]['function']['include']);
}
if (!empty($this->fieldDefs[$name]['function']['returns']) && $this->fieldDefs[$name]['function']['returns'] == 'html') {
if (
!empty($this->fieldDefs[$name]['function']['returns']) &&
$this->fieldDefs[$name]['function']['returns'] === 'html'
) {
if (!empty($this->fieldDefs[$name]['function']['include'])) {
require_once($this->fieldDefs[$name]['function']['include']);
}
$value = call_user_func($function, $this->focus, $name, $value, $this->view);
$valueFormatted = true;
} else {
$this->fieldDefs[$name]['options'] = call_user_func($function, $this->focus, $name, $value,
$this->view);
$this->fieldDefs[$name]['options'] = call_user_func(
$function,
$this->focus,
$name, $value,
$this->view
);
}
}
if (isset($this->fieldDefs[$name]['type']) && $this->fieldDefs[$name]['type'] == 'function' && isset($this->fieldDefs[$name]['function_name'])) {
if (
isset($this->fieldDefs[$name]['type']) &&
$this->fieldDefs[$name]['type'] === 'function' &&
isset($this->fieldDefs[$name]['function_name'])
) {
$value = $this->callFunction($this->fieldDefs[$name]);
$valueFormatted = true;
}
@ -620,10 +676,21 @@ class EditView
}
//This code is used for QuickCreates that go to Full Form view. We want to overwrite the values from the bean
//with values from the request if they are set and either the bean is brand new (such as a create from a subpanels) or the 'full form' button has been clicked
if ((($this->populateBean && empty($this->focus->id)) || (isset($_REQUEST['full_form'])))
&& (!isset($this->fieldDefs[$name]['function']['returns']) || $this->fieldDefs[$name]['function']['returns'] != 'html')
// This code is used for QuickCreates that go to Full Form view. We want to overwrite the values
// from the bean with values from the request if they are set and either the bean is brand new
// (such as a create from a subpanels) or the 'full form' button has been clicked
if (
(
(
$this->populateBean &&
empty($this->focus->id)
) ||
isset($_REQUEST['full_form'])
) &&
(
!isset($this->fieldDefs[$name]['function']['returns']) ||
$this->fieldDefs[$name]['function']['returns'] != 'html'
)
&& isset($_REQUEST[$name])
) {
$this->fieldDefs[$name]['value'] = $this->getValueFromRequest($_REQUEST, $name);
@ -633,16 +700,19 @@ class EditView
* Populate any relate fields that are linked by a relationship to the calling module.
* Clicking the create button on a subpanel for example will populate three values in the $_REQUEST:
* 1. return_module => the name of the calling module
* 2. return_id => the id of the record in the calling module that the user was viewing and that should be associated with this new record
* 3. return_name => the display value of the return_id record - the value to show in any relate field in this EditView
* Only do if this fieldDef does not already have a value; if it does it will have been explicitly set, and that should overrule this less specific mechanism
* 2. return_id => the id of the record in the calling module that the user was viewing and
* that should be associated with this new record
* 3. return_name => the display value of the return_id record - the value to show in any relate field
* in this EditView
* Only do if this fieldDef does not already have a value; if it does it will have been explicitly set,
* and that should overrule this less specific mechanism
*/
if (isset($this->returnModule) && isset($this->returnName)
&& empty($this->focus->id) && empty($this->fieldDefs['name']['value'])
) {
if (($this->focus->field_defs[$name]['type'] == 'relate')
if (($this->focus->field_defs[$name]['type'] === 'relate')
&& isset($this->focus->field_defs[$name]['module'])
&& $this->focus->field_defs[$name]['module'] == $this->returnModule
&& $this->focus->field_defs[$name]['module'] === $this->returnModule
) {
if (isset($this->fieldDefs[$name]['id_name'])
&& !empty($this->returnRelationship)
@ -682,11 +752,10 @@ class EditView
*/
public function display($showTitle = true, $ajaxSave = false)
{
global $mod_strings, $sugar_config, $app_strings, $app_list_strings, $theme, $current_user;
global $mod_strings, $sugar_config, $app_strings, $current_user;
if (isset($this->defs['templateMeta']['javascript'])) {
if (is_array($this->defs['templateMeta']['javascript'])) {
//$this->th->ss->assign('externalJSFile', 'modules/' . $this->module . '/metadata/editvewdefs.js');
$this->th->ss->assign('externalJSFile', $this->defs['templateMeta']['javascript']);
} else {
$this->th->ss->assign('scriptBlocks', $this->defs['templateMeta']['javascript']);
@ -717,7 +786,7 @@ class EditView
$this->th->ss->assign('current_user', $current_user);
$this->th->ss->assign('bean', $this->focus);
$this->th->ss->assign('isAuditEnabled', $this->focus->is_AuditEnabled());
$this->th->ss->assign('gridline', $current_user->getPreference('gridline') == 'on' ? '1' : '0');
$this->th->ss->assign('gridline', $current_user->getPreference('gridline') === 'on' ? '1' : '0');
$this->th->ss->assign('tabDefs',
isset($this->defs['templateMeta']['tabDefs']) ? $this->defs['templateMeta']['tabDefs'] : false);
$this->th->ss->assign('VERSION_MARK', getVersionedPath(''));
@ -745,8 +814,8 @@ class EditView
//$this->defs['templateMeta']['form']['buttons']['ajax_save'] = array('id' => 'AjaxSave', 'customCode'=>'<input type="button" class="button" value="Save" onclick="this.form.action.value=\'AjaxFormSave\';return saveForm(\''.$form_name.'\', \'multiedit_form_{$module}\', \'Saving {$module}...\');"/>');
}
$form_name = $form_name == 'QuickCreate' ? "QuickCreate_{$this->module}" : $form_name;
$form_id = $form_id == 'QuickCreate' ? "QuickCreate_{$this->module}" : $form_id;
$form_name = $form_name === 'QuickCreate' ? "QuickCreate_{$this->module}" : $form_name;
$form_id = $form_id === 'QuickCreate' ? "QuickCreate_{$this->module}" : $form_id;
if (isset($this->defs['templateMeta']['preForm'])) {
$this->th->ss->assign('preForm', $this->defs['templateMeta']['preForm']);
@ -763,7 +832,7 @@ class EditView
//for SugarFieldImage, we must set form enctype to "multipart/form-data"
foreach ($this->fieldDefs as $field) {
if (isset($field['type']) && $field['type'] == 'image') {
if (isset($field['type']) && $field['type'] === 'image') {
$this->th->ss->assign('enctype', 'enctype="multipart/form-data"');
break;
}
@ -798,10 +867,10 @@ class EditView
// Create Smarty variables for the Calendar picker widget
$t23 = strpos($time_format, '23') !== false ? '%H' : '%I';
if (!isset($match[2]) || $match[2] == '') {
if (!isset($match[2]) || empty($match[2])) {
$this->th->ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . '%M');
} else {
$pm = $match[2] == 'pm' ? '%P' : '%p';
$pm = $match[2] === 'pm' ? '%P' : '%p';
$this->th->ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . '%M' . $pm);
}
@ -812,7 +881,7 @@ class EditView
$this->th->ss->assign('NUM_GRP_SEP', $seps[0]);
$this->th->ss->assign('DEC_SEP', $seps[1]);
if ($this->view == 'EditView') {
if ($this->view === 'EditView') {
$height = $current_user->getPreference('text_editor_height');
$width = $current_user->getPreference('text_editor_width');
@ -843,21 +912,25 @@ class EditView
/* BEGIN - SECURITY GROUPS */
//if popup select add panel if user is a member of multiple groups to metadataFile
global $sugar_config;
if (isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true
&& empty($this->focus->fetched_row['id']) && $this->focus->module_dir != "Users" && $this->focus->module_dir != "SugarFeed"
if (
$this->focus->module_dir !== "Users" &&
$this->focus->module_dir !== "SugarFeed" &&
$sugar_config['securitysuite_popup_select'] === true &&
isset($sugar_config['securitysuite_popup_select']) &&
empty($this->focus->fetched_row['id'])
) {
//there are cases such as uploading an attachment to an email template where the request module may
//not be the same as the current bean module. If that happens we can just skip it
//however...let quickcreate through
if ($this->view != 'QuickCreate' && (empty($_REQUEST['module']) || $_REQUEST['module'] != $this->focus->module_dir)) {
if ($this->view !== 'QuickCreate' && (empty($_REQUEST['module']) || $_REQUEST['module'] !== $this->focus->module_dir)) {
return $str;
}
require_once('modules/SecurityGroups/SecurityGroup.php');
$groupFocus = new SecurityGroup();
$security_modules = $groupFocus->getSecurityModules();
if (in_array($this->focus->module_dir, array_keys($security_modules))) {
if (array_key_exists($this->focus->module_dir, $security_modules)) {
global $current_user;
$group_count = $groupFocus->getMembershipCount($current_user->id);
@ -911,11 +984,18 @@ EOQ;
return $str;
}
/**
* @param $javascript
*/
public function insertJavascript($javascript)
{
$this->ss->assign('javascript', $javascript);
}
/**
* @param $vardef
* @return mixed|string
*/
public function callFunction($vardef)
{
$can_execute = true;
@ -929,14 +1009,14 @@ EOQ;
}
foreach ($vardef['function_params'] as $param) {
if (empty($vardef['function_params_source']) or $vardef['function_params_source'] == 'parent') {
if (empty($vardef['function_params_source']) || $vardef['function_params_source'] === 'parent') {
if (empty($this->focus->$param)) {
$can_execute = false;
} else {
$execute_params[] = $this->focus->$param;
}
} else {
if ($vardef['function_params_source'] == 'this') {
if ($vardef['function_params_source'] === 'this') {
if (empty($this->focus->$param)) {
$can_execute = false;
} else {
@ -967,9 +1047,9 @@ EOQ;
* with 'date_' by checking to see if they also include time
* and meridiem values
*
* @param request The request Array
* @param name The field name to extract value for
* @return String value for given name
* @param array $request The request Array
* @param string $name The field name to extract value for
* @return string value for given name
*/
public function getValueFromRequest($request, $name)
{
@ -977,17 +1057,24 @@ EOQ;
if (preg_match('/^date_(.*)$/s', $name, $matches)) {
$d = $request[$name];
if (isset($request['time_' . $matches[1]])) {
$d .= ' ' . $request['time_' . $matches[1]];
if (isset($request[$matches[1] . '_meridiem'])) {
$d .= $request[$matches[1] . '_meridiem'];
$key = $matches[1];
$timeKey = 'time_' . $key;
if (isset($request[$timeKey])) {
$keyMeridiem = $key . '_meridiem';
$d .= ' ' . $request[$timeKey];
if (isset($request[$keyMeridiem])) {
$d .= $request[$keyMeridiem];
}
} else {
if (isset($request['time_hour_' . $matches[1]])
&& isset($request['time_minute_' . $matches[1]])
$timeHourKey = 'time_hour_' . $key;
$timeMinuteKey = 'time_minute_' . $key;
if (isset($request[$timeHourKey])
&& isset($request[$timeMinuteKey])
) {
$d .= sprintf(' %s:%s', $request['time_hour_' . $matches[1]],
$request['time_minute_' . $matches[1]]);
$d .= sprintf(' %s:%s', $request[$timeHourKey],
$request[$timeMinuteKey]);
}
if (isset($request['meridiem'])) {
@ -1009,7 +1096,7 @@ EOQ;
$type = !empty($this->fieldDefs[$name]['custom_type'])
? $this->fieldDefs[$name]['custom_type']
: $this->fieldDefs[$name]['type'];
$sf = $sfh->getSugarField($type);
$sf = $sfh::getSugarField($type);
return $sf ? $sf->unformatField($request[$name], $this->fieldDefs[$name]) : $request[$name];
}
@ -1022,9 +1109,7 @@ EOQ;
*/
public function showTitle($showTitle = false)
{
global $mod_strings, $app_strings;
if (is_null($this->viewObject)) {
if ($this->viewObject === null) {
$this->viewObject = (!empty($GLOBALS['current_view']))
? $GLOBALS['current_view']
: new SugarView();

View file

@ -0,0 +1,52 @@
<?php
/**
*
* 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 - 2017 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
* Class SugarControllerException
*/
class SugarControllerException extends Exception
{
}

View file

@ -0,0 +1,45 @@
<?php
/**
*
* 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 - 2017 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
class SuiteException extends Exception {}

View file

@ -340,7 +340,14 @@ function saveField($field, $id, $module, $value)
}
}
$bean->save($check_notify);
if($bean->ACLAccess("edit") || is_admin($current_user)) {
if(!$bean->save($check_notify)) {
$GLOBALS['log']->fatal("Saving probably failed or bean->save() method did not return with a positive result.");
}
} else {
$GLOBALS['log']->fatal("ACLAccess denied to save this field.");
}
$bean->retrieve();
return getDisplayValue($bean, $field);
} else {
return false;
@ -357,8 +364,6 @@ function getDisplayValue($bean, $field, $method = "save")
$metadata = require("modules/Accounts/metadata/listviewdefs.php");
}
$listViewDefs = $listViewDefs['Accounts'][strtoupper($field)];
$fieldlist[$field] = $bean->getFieldDefinition($field);
if(is_array($listViewDefs)){
@ -392,7 +397,7 @@ function formatDisplayValue($bean, $value, $vardef, $method = "save")
}
//If field is of type link and name.
if ($vardef['link'] && $vardef['type'] == "name" && $_REQUEST['view'] != "DetailView") {
if (isset($vardef['link']) && $vardef['link'] && $vardef['type'] == "name" && $_REQUEST['view'] != "DetailView") {
require_once("include/generic/SugarWidgets/SugarWidgetSubPanelDetailViewLink.php");

View file

@ -206,16 +206,22 @@ class ListViewDisplay {
return $filter_fields;
}
/**
* Any additional processing
* @param file File template file to use
* @param data array row data
* @param html_var string html string to be passed back and forth
*
* @param $file (legacy, unused) File template file to use
* @param array $data array row data
* @param string $htmlVar html string to be passed back and forth
* @return bool
*/
function process($file, $data, $htmlVar) {
$this->rowCount = count($data['data']);
if(!isset($data['pageData']['bean'])) {
$GLOBALS['log']->warn("List view process error: Invalid data, bean is not set");
return false;
}
$this->moduleString = $data['pageData']['bean']['moduleDir'] . '2_' . strtoupper($htmlVar) . '_offset';
return true;
}
/**
@ -331,7 +337,8 @@ class ListViewDisplay {
foreach ( $this->actionsMenuExtraItems as $item )
$menuItems[] = $item;
if(!$this->show_action_dropdown_as_delete) {
if($this->delete && !$this->show_action_dropdown_as_delete) {
$menuItems[] = $this->buildDeleteLink($location);
}
}

View file

@ -1,11 +1,11 @@
{*
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,35 +34,32 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
{include file='include/ListView/ListViewColumnsFilterDialog.tpl'}
<script type='text/javascript' src='{sugar_getjspath file='include/javascript/popup_helper.js'}'></script>
<script>
{literal}
$(document).ready(function(){
$("ul.clickMenu").each(function(index, node){
$(node).sugarActionMenu();
});
{literal}
$(document).ready(function () {
$("ul.clickMenu").each(function (index, node) {
$(node).sugarActionMenu();
});
$('.selectActionsDisabled').children().each(function(index) {
$(this).attr('onclick','').unbind('click');
});
$('.selectActionsDisabled').children().each(function (index) {
$(this).attr('onclick', '').unbind('click');
});
var selectedTopValue = $("#selectCountTop").attr("value");
if(typeof(selectedTopValue) != "undefined" && selectedTopValue != "0"){
sugarListView.prototype.toggleSelected();
}
});
{/literal}
var selectedTopValue = $("#selectCountTop").attr("value");
if (typeof(selectedTopValue) != "undefined" && selectedTopValue != "0") {
sugarListView.prototype.toggleSelected();
}
});
{/literal}
</script>
{assign var="currentModule" value = $pageData.bean.moduleDir}
{assign var="singularModule" value = $moduleListSingular.$currentModule}
@ -70,239 +67,248 @@
{assign var="hideTable" value=false}
{if count($data) == 0}
{assign var="hideTable" value=true}
<div class="list view listViewEmpty">
{if $displayEmptyDataMesssages}
{if strlen($query) == 0}
{capture assign="createLink"}<a href="?module={$pageData.bean.moduleDir}&action=EditView&return_module={$pageData.bean.moduleDir}&return_action=DetailView">{$APP.LBL_CREATE_BUTTON_LABEL}</a>{/capture}
{capture assign="importLink"}<a href="?module=Import&action=Step1&import_module={$pageData.bean.moduleDir}&return_module={$pageData.bean.moduleDir}&return_action=index">{$APP.LBL_IMPORT}</a>{/capture}
{capture assign="helpLink"}<a target="_blank" href='?module=Administration&action=SupportPortal&view=documentation&version={$sugar_info.sugar_version}&edition={$sugar_info.sugar_flavor}&lang=&help_module={$currentModule}&help_action=&key='>{$APP.LBL_CLICK_HERE}</a>{/capture}
{assign var="hideTable" value=true}
<div class="list view listViewEmpty">
{if $displayEmptyDataMesssages}
{if strlen($query) == 0}
{capture assign="createLink"}<a
href="?module={$pageData.bean.moduleDir}&action=EditView&return_module={$pageData.bean.moduleDir}&return_action=DetailView">{$APP.LBL_CREATE_BUTTON_LABEL}</a>{/capture}
{capture assign="importLink"}<a
href="?module=Import&action=Step1&import_module={$pageData.bean.moduleDir}&return_module={$pageData.bean.moduleDir}&return_action=index">{$APP.LBL_IMPORT}</a>{/capture}
{capture assign="helpLink"}<a target="_blank"
href='?module=Administration&action=SupportPortal&view=documentation&version={$sugar_info.sugar_version}&edition={$sugar_info.sugar_flavor}&lang=&help_module={$currentModule}&help_action=&key='>{$APP.LBL_CLICK_HERE}</a>{/capture}
<p class="msg">
{$APP.MSG_EMPTY_LIST_VIEW_NO_RESULTS|replace:"<item2>":$createLink|replace:"<item3>":$importLink}
</p>
{elseif $query == "-advanced_search"}
<p class="msg">
{$APP.MSG_LIST_VIEW_NO_RESULTS_BASIC}
</p>
{elseif $query == "-advanced_search"}
<p class="msg emptyResults">
{$APP.MSG_LIST_VIEW_NO_RESULTS_CHANGE_CRITERIA}
</p>
{else}
<p class="msg">
{capture assign="quotedQuery"}"{$query}"{/capture}
{$APP.MSG_LIST_VIEW_NO_RESULTS|replace:"<item1>":$quotedQuery}
</p>
<p class="submsg">
<a href="?module={$pageData.bean.moduleDir}&action=EditView&return_module={$pageData.bean.moduleDir}&return_action=DetailView">
{$APP.MSG_LIST_VIEW_NO_RESULTS_SUBMSG|replace:"<item1>":$quotedQuery|replace:"<item2>":$singularModule}
</a>
</p>
{/if}
{else}
<p class="msg">
{capture assign="quotedQuery"}"{$query}"{/capture}
{$APP.MSG_LIST_VIEW_NO_RESULTS|replace:"<item1>":$quotedQuery}
</p>
<p class = "submsg">
<a href="?module={$pageData.bean.moduleDir}&action=EditView&return_module={$pageData.bean.moduleDir}&return_action=DetailView">
{$APP.MSG_LIST_VIEW_NO_RESULTS_SUBMSG|replace:"<item1>":$quotedQuery|replace:"<item2>":$singularModule}
</a>
{$APP.LBL_NO_DATA}
</p>
{/if}
{else}
<p class="msg">
{$APP.LBL_NO_DATA}
</p>
{/if}
<p class="msg">
{$APP.MSG_LIST_VIEW_CHANGE_SEARCH}
</p>
{if $showFilterIcon}
{include file='include/ListView/ListViewSearchLink.tpl'}
{/if}
</div>
{if $showFilterIcon}
{include file='include/ListView/ListViewSearchLink.tpl'}
{/if}
</div>
{/if}
{$multiSelectData}
{if $hideTable == false}
<table cellpadding='0' cellspacing='0' width='100%' border='0' class='list view table'>
<thead>
{assign var="link_select_id" value="selectLinkTop"}
{assign var="link_action_id" value="actionLinkTop"}
{assign var="actionsLink" value=$actionsLinkTop}
{assign var="selectLink" value=$selectLinkTop}
{assign var="action_menu_location" value="top"}
{include file='include/ListView/ListViewPagination.tpl'}
<tr height='20'>
{if $prerow}
<td width='1%' class="td_alt">
&nbsp;
</td>
{/if}
{if !empty($quickViewLinks)}
<td class='td_alt' width='1%' style="padding: 0px;">&nbsp;</td>
{/if}
{counter start=0 name="colCounter" print=false assign="colCounter"}
<table cellpadding='0' cellspacing='0' width='100%' border='0' class='list view table'>
<thead>
{assign var="link_select_id" value="selectLinkTop"}
{assign var="link_action_id" value="actionLinkTop"}
{assign var="actionsLink" value=$actionsLinkTop}
{assign var="selectLink" value=$selectLinkTop}
{assign var="action_menu_location" value="top"}
{include file='include/ListView/ListViewPagination.tpl'}
<tr height='20'>
{if $prerow}
<td width='1%' class="td_alt">
&nbsp;
</td>
{/if}
{if !empty($quickViewLinks)}
<td class='td_alt' width='1%' style="padding: 0px;">&nbsp;</td>
{/if}
{counter start=0 name="colCounter" print=false assign="colCounter"}
{assign var='datahide' value="phone"}
{foreach from=$displayColumns key=colHeader item=params}
{foreach from=$displayColumns key=colHeader item=params}
{if $colCounter == '3'}{assign var='datahide' value="phone,phonelandscape"}{/if}
{if $colCounter == '5'}{assign var='datahide' value="phone,phonelandscape,tablet"}{/if}
{if $colCounter == '0'}
{assign var='hiddenclass' value=""}
{elseif $colCounter < '5'}
{assign var='hiddenclass' value="hidden-xs"}
{elseif $colCounter >= '5'}
{assign var='hiddenclass' value="hidden-xs hidden-sm hidden-md"}
{assign var='hiddenclass' value=""}
{elseif $colCounter < '5'}
{assign var='hiddenclass' value="hidden-xs"}
{elseif $colCounter >= '5'}
{assign var='hiddenclass' value="hidden-xs hidden-sm hidden-md"}
{/if}
{if $colHeader == 'NAME' || $params.bold}<th scope='col' data-toggle="true" class="{$hiddenclass}">
{else}<th scope='col' data-hide="{$datahide}" class="{$hiddenclass}">{/if}
<div style='white-space: normal;'width='100%' align='{$params.align|default:'left'}'>
{if $params.sortable|default:true}
{if $params.url_sort}
<a href='{$pageData.urls.orderBy}{$params.orderBy|default:$colHeader|lower}' class='listViewThLinkS1'>
{else}
{if $params.orderBy|default:$colHeader|lower == $pageData.ordering.orderBy}
<a href='javascript:sListView.order_checks("{$pageData.ordering.sortOrder|default:ASCerror}", "{$params.orderBy|default:$colHeader|lower}" , "{$pageData.bean.moduleDir}{"2_"}{$pageData.bean.objectName|upper}{"_ORDER_BY"}")' class='listViewThLinkS1'>
{else}
<a href='javascript:sListView.order_checks("ASC", "{$params.orderBy|default:$colHeader|lower}" , "{$pageData.bean.moduleDir}{"2_"}{$pageData.bean.objectName|upper}{"_ORDER_BY"}")' class='listViewThLinkS1'>
{/if}
{/if}
{sugar_translate label=$params.label module=$pageData.bean.moduleDir}
&nbsp;&nbsp;
{if $params.orderBy|default:$colHeader|lower == $pageData.ordering.orderBy}
{if $pageData.ordering.sortOrder == 'ASC'}
{capture assign="imageName"}arrow_down.{$arrowExt}{/capture}
{capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT_DESC'}{/capture}
{sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
{else}
{capture assign="imageName"}arrow_up.{$arrowExt}{/capture}
{capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT_ASC'}{/capture}
{sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
{/if}
{else}
{capture assign="imageName"}arrow.{$arrowExt}{/capture}
{capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT'}{/capture}
{sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
{/if}
</a>
{else}
{if !isset($params.noHeader) || $params.noHeader == false}
{sugar_translate label=$params.label module=$pageData.bean.moduleDir}
{/if}
{/if}
</div>
</th>
{counter name="colCounter"}
{/foreach}
<th width='1%' class="td_alt">
&nbsp;
</th>
</tr>
</thead>
{counter start=$pageData.offsets.current print=false assign="offset" name="offset"}
{foreach name=rowIteration from=$data key=id item=rowData}
{counter name="offset" print=false}
{assign var='scope_row' value=true}
{if $colHeader == 'NAME' || $params.bold}
<th scope='col' data-toggle="true" class="{$hiddenclass}">
{else}<th scope='col' data-hide="{$datahide}" class="{$hiddenclass}">{/if}
<div style='white-space: normal;' width='100%' align='{$params.align|default:'left'}'>
{if $params.sortable|default:true}
{if $params.url_sort}
<a href='{$pageData.urls.orderBy}{$params.orderBy|default:$colHeader|lower}'
class='listViewThLinkS1'>
{else}
{if $params.orderBy|default:$colHeader|lower == $pageData.ordering.orderBy}
<a href='javascript:sListView.order_checks("{$pageData.ordering.sortOrder|default:ASCerror}", "{$params.orderBy|default:$colHeader|lower}" , "{$pageData.bean.moduleDir}{"2_"}{$pageData.bean.objectName|upper}{"_ORDER_BY"}")'
class='listViewThLinkS1'>
{else}
<a href='javascript:sListView.order_checks("ASC", "{$params.orderBy|default:$colHeader|lower}" , "{$pageData.bean.moduleDir}{"2_"}{$pageData.bean.objectName|upper}{"_ORDER_BY"}")'
class='listViewThLinkS1'>
{/if}
{/if}
{sugar_translate label=$params.label module=$pageData.bean.moduleDir}
&nbsp;&nbsp;
{if $params.orderBy|default:$colHeader|lower == $pageData.ordering.orderBy}
{if $pageData.ordering.sortOrder == 'ASC'}
{capture assign="imageName"}arrow_down.{$arrowExt}{/capture}
{capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT_DESC'}{/capture}
{sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
{else}
{capture assign="imageName"}arrow_up.{$arrowExt}{/capture}
{capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT_ASC'}{/capture}
{sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
{/if}
{else}
{capture assign="imageName"}arrow.{$arrowExt}{/capture}
{capture assign="alt_sort"}{sugar_translate label='LBL_ALT_SORT'}{/capture}
{sugar_getimage name=$imageName attr='align="absmiddle" border="0" ' alt="$alt_sort"}
{/if}
</a>
{else}
{if !isset($params.noHeader) || $params.noHeader == false}
{sugar_translate label=$params.label module=$pageData.bean.moduleDir}
{/if}
{/if}
</div>
</th>
{counter name="colCounter"}
{/foreach}
<th width='1%' class="td_alt">
&nbsp;
</th>
</tr>
</thead>
{counter start=$pageData.offsets.current print=false assign="offset" name="offset"}
{foreach name=rowIteration from=$data key=id item=rowData}
{counter name="offset" print=false}
{assign var='scope_row' value=true}
{if $smarty.foreach.rowIteration.iteration is odd}
{assign var='_rowColor' value=$rowColor[0]}
{else}
{assign var='_rowColor' value=$rowColor[1]}
{/if}
<tr height='20' class='{$_rowColor}S1'>
{if $prerow}
<td width='1%' class='nowrap'>
{if !$is_admin && is_admin_for_user && $rowData.IS_ADMIN==1}
<input type='checkbox' disabled="disabled" class='checkbox' value='{$rowData.ID}'>
{else}
<input title="{sugar_translate label='LBL_SELECT_THIS_ROW_TITLE'}" onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox' class='checkbox' name='mass[]' value='{$rowData.ID}'>
{/if}
</td>
{/if}
{if !empty($quickViewLinks)}
{capture assign=linkModule}{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}{/capture}
{capture assign=action}{if $act}{$act}{else}EditView{/if}{/capture}
<td width='2%' nowrap>
{if $pageData.rowAccess[$id].edit}
{if $linkModule != 'AOR_Reports'}
<a title='{$editLinkString}' id="edit-{$rowData.ID}"
href="index.php?module={$linkModule}&offset={$offset}&stamp={$pageData.stamp}&return_module={$linkModule}&action={$action}&record={$rowData.ID}"
{if $smarty.foreach.rowIteration.iteration is odd}
{assign var='_rowColor' value=$rowColor[0]}
{else}
{assign var='_rowColor' value=$rowColor[1]}
{/if}
<tr height='20' class='{$_rowColor}S1'>
{if $prerow}
<td width='1%' class='nowrap'>
{if !$is_admin && is_admin_for_user && $rowData.IS_ADMIN==1}
<input type='checkbox' disabled="disabled" class='checkbox' value='{$rowData.ID}'>
{else}
<input title="{sugar_translate label='LBL_SELECT_THIS_ROW_TITLE'}"
onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox'
class='checkbox' name='mass[]' value='{$rowData.ID}'>
{/if}
</td>
{/if}
{if !empty($quickViewLinks)}
{capture assign=linkModule}{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$pageData.bean.moduleDir}{/if}{/capture}
{capture assign=action}{if $act}{$act}{else}EditView{/if}{/capture}
<td width='2%' nowrap>
{if $pageData.rowAccess[$id].edit}
{if $linkModule != 'AOR_Reports'}
<a title='{$editLinkString}' id="edit-{$rowData.ID}"
href="index.php?module={$linkModule}&offset={$offset}&stamp={$pageData.stamp}&return_module={$linkModule}&action={$action}&record={$rowData.ID}"
>
{capture name='tmp1' assign='alt_edit'}{sugar_translate label="LNK_EDIT"}{/capture}
{sugar_getimage name="edit_inline.gif" attr='border="0" ' alt="$alt_edit"}</a>
{/if}
{capture name='tmp1' assign='alt_edit'}{sugar_translate label="LNK_EDIT"}{/capture}
{sugar_getimage name="edit_inline.gif" attr='border="0" ' alt="$alt_edit"}</a>
{/if}
{/if}
</td>
{/if}
{counter start=0 name="colCounter" print=false assign="colCounter"}
{foreach from=$displayColumns key=col item=params}
{if $colCounter == '0'}
{assign var='hiddenclass' value=""}
{elseif $colCounter < '5'}
{assign var='hiddenclass' value="hidden-xs"}
{elseif $colCounter >= '5'}
{assign var='hiddenclass' value="hidden-xs hidden-sm hidden-md"}
{/if}
</td>
{/if}
{counter start=0 name="colCounter" print=false assign="colCounter"}
{foreach from=$displayColumns key=col item=params}
{if $colCounter == '0'}
{assign var='hiddenclass' value=""}
{elseif $colCounter < '5'}
{assign var='hiddenclass' value="hidden-xs"}
{elseif $colCounter >= '5'}
{assign var='hiddenclass' value="hidden-xs hidden-sm hidden-md"}
{/if}
{$displayColumns[type]}
{strip}
<td {if $scope_row} scope='row' {/if} align='{$params.align|default:'left'}' valign="top" type="{$displayColumns.$col.type}" field="{$col|lower}" class="{$hiddenclass} {if $inline_edit && ($displayColumns.$col.inline_edit == 1 || !isset($displayColumns.$col.inline_edit))}inlineEdit{/if}{if ($params.type == 'teamset')}nowrap{/if}{if preg_match('/PHONE/', $col)} phone{/if}">
{if $col == 'NAME' || $params.bold}<b>{/if}
{if $params.link && !$params.customCode}
{capture assign=linkModule}{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$params.module|default:$pageData.bean.moduleDir}{/if}{/capture}
{capture assign=action}{if $act}{$act}{else}DetailView{/if}{/capture}
{capture assign=record}{$rowData[$params.id]|default:$rowData.ID}{/capture}
{capture assign=url}index.php?module={$linkModule}&offset={$offset}&stamp={$pageData.stamp}&return_module={$linkModule}&action={$action}&record={$record}{/capture}
<{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN} href="{sugar_ajax_url url=$url}">
{/if}
{strip}
<td {if $scope_row} scope='row' {/if} align='{$params.align|default:'left'}' valign="top"
type="{$displayColumns.$col.type}" field="{$col|lower}"
class="{$hiddenclass} {if $inline_edit && ($displayColumns.$col.inline_edit == 1 || !isset($displayColumns.$col.inline_edit))}inlineEdit{/if}{if ($params.type == 'teamset')}nowrap{/if}{if preg_match('/PHONE/', $col)} phone{/if}">
{if $col == 'NAME' || $params.bold}<b>{/if}
{if $params.link && !$params.customCode}
{capture assign=linkModule}{if $params.dynamic_module}{$rowData[$params.dynamic_module]}{else}{$params.module|default:$pageData.bean.moduleDir}{/if}{/capture}
{capture assign=action}{if $act}{$act}{else}DetailView{/if}{/capture}
{capture assign=record}{$rowData[$params.id]|default:$rowData.ID}{/capture}
{capture assign=url}index.php?module={$linkModule}&offset={$offset}&stamp={$pageData.stamp}&return_module={$linkModule}&action={$action}&record={$record}{/capture}
<{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN} href="{sugar_ajax_url url=$url}">
{/if}
{if $params.customCode}
{sugar_evalcolumn_old var=$params.customCode rowData=$rowData}
{else}
{sugar_field parentFieldArray=$rowData vardef=$params displayType=ListView field=$col}
{if $params.customCode}
{sugar_evalcolumn_old var=$params.customCode rowData=$rowData}
{else}
{sugar_field parentFieldArray=$rowData vardef=$params displayType=ListView field=$col}
{/if}
{if empty($rowData.$col) && empty($params.customCode)}&nbsp;{/if}
{if $params.link && !$params.customCode}
</{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN}>
{/if}
{if $inline_edit && ($displayColumns.$col.inline_edit == 1 || !isset($displayColumns.$col.inline_edit))}<div class="inlineEditIcon">{sugar_getimage name="inline_edit_icon.svg" attr='border="0" ' alt="$alt_edit"}</div>{/if}
</td>
{/strip}
{assign var='scope_row' value=false}
{counter name="colCounter"}
{/if}
{if empty($rowData.$col) && empty($params.customCode)}&nbsp;{/if}
{if $params.link && !$params.customCode}
</{$pageData.tag.$id[$params.ACLTag]|default:$pageData.tag.$id.MAIN}>
{/if}
{if $inline_edit && ($displayColumns.$col.inline_edit == 1 || !isset($displayColumns.$col.inline_edit))}
<div class="inlineEditIcon">{sugar_getimage name="inline_edit_icon.svg" attr='border="0" ' alt="$alt_edit"}</div>{/if}
</td>
{/strip}
{assign var='scope_row' value=false}
{counter name="colCounter"}
{/foreach}
<td align='right'>{$pageData.additionalDetails.$id}</td>
</tr>
{foreachelse}
<tr height='20' class='{$rowColor[0]}S1'>
<td colspan="{$colCount}">
<em>{$APP.LBL_NO_DATA}</em>
</td>
</tr>
{/foreach}
{assign var="link_select_id" value="selectLinkBottom"}
{assign var="link_action_id" value="actionLinkBottom"}
{assign var="selectLink" value=$selectLinkBottom}
{assign var="actionsLink" value=$actionsLinkBottom}
{assign var="action_menu_location" value="bottom"}
{include file='include/ListView/ListViewPagination.tpl'}
</table>
{/foreach}
<td align='right'>{$pageData.additionalDetails.$id}</td>
</tr>
{foreachelse}
<tr height='20' class='{$rowColor[0]}S1'>
<td colspan="{$colCount}">
<em>{$APP.LBL_NO_DATA}</em>
</td>
</tr>
{/foreach}
{assign var="link_select_id" value="selectLinkBottom"}
{assign var="link_action_id" value="actionLinkBottom"}
{assign var="selectLink" value=$selectLinkBottom}
{assign var="actionsLink" value=$actionsLinkBottom}
{assign var="action_menu_location" value="bottom"}
{include file='include/ListView/ListViewPagination.tpl'}
</table>
{/if}
{if $contextMenus}
<script type="text/javascript">
{$contextMenuScript}
{literal}
function lvg_nav(m,id,act,offset,t){
if(t.href.search(/#/) < 0){return;}
else{
if(act=='pte'){
act='ProjectTemplatesEditView';
}
else if(act=='d'){
act='DetailView';
}else if( act =='ReportsWizard'){
act = 'ReportsWizard';
}else{
act='EditView';
}
{/literal}
url = 'index.php?module='+m+'&offset=' + offset + '&stamp={$pageData.stamp}&return_module='+m+'&action='+act+'&record='+id;
t.href=url;
{literal}
}
}{/literal}
{literal}
function lvg_dtails(id){{/literal}
return SUGAR.util.getAdditionalDetails( '{$pageData.bean.moduleDir|default:$params.module}',id, 'adspan_'+id);{literal}}{/literal}
</script>
<script type="text/javascript" src="include/InlineEditing/inlineEditing.js"></script>
<script type="text/javascript">
{$contextMenuScript}
{literal}
function lvg_nav(m, id, act, offset, t) {
if (t.href.search(/#/) < 0) {
return;
}
else {
if (act == 'pte') {
act = 'ProjectTemplatesEditView';
}
else if (act == 'd') {
act = 'DetailView';
} else if (act == 'ReportsWizard') {
act = 'ReportsWizard';
} else {
act = 'EditView';
}
{/literal}
url = 'index.php?module=' + m + '&offset=' + offset + '&stamp={$pageData.stamp}&return_module=' + m + '&action=' + act + '&record=' + id;
t.href = url;
{literal}
}
}{/literal}
{literal}
function lvg_dtails(id) {{/literal}
return SUGAR.util.getAdditionalDetails('{$pageData.bean.moduleDir|default:$params.module}', id, 'adspan_' + id);{literal}}{/literal}
</script>
<script type="text/javascript" src="include/InlineEditing/inlineEditing.js"></script>
{/if}

View file

@ -141,14 +141,19 @@ class ListViewSmarty extends ListViewDisplay
$this->ss->assign('recordsLinkString',$app_strings['LBL_LINK_RECORDS']);
$this->ss->assign('selectLinkString',$app_strings['LBL_LINK_SELECT']);
// Bug 24677 - Correct the page total amount on the last page of listviews
$pageTotal = $this->data['pageData']['offsets']['next']-$this->data['pageData']['offsets']['current'];
if ( $this->data['pageData']['offsets']['next'] < 0 ) {
$pageTotal = $this->data['pageData']['offsets']['total'] - $this->data['pageData']['offsets']['current'];
}
if(!isset($this->data['pageData']['offsets'])) {
$GLOBALS['log']->warn('Incorrect pageData: offset is not set');
} else {
// Bug 24677 - Correct the page total amount on the last page of listviews
$pageTotal = $this->data['pageData']['offsets']['next'] - $this->data['pageData']['offsets']['current'];
if ($this->data['pageData']['offsets']['next'] < 0) {
$pageTotal = $this->data['pageData']['offsets']['total'] - $this->data['pageData']['offsets']['current'];
}
if($this->select)$this->ss->assign('selectLinkTop', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $pageTotal));
if($this->select)$this->ss->assign('selectLinkBottom', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $pageTotal, "bottom"));
if($this->select)$this->ss->assign('selectLinkTop', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $pageTotal));
if($this->select)$this->ss->assign('selectLinkBottom', $this->buildSelectLink('select_link', $this->data['pageData']['offsets']['total'], $pageTotal, "bottom"));
}
if($this->show_action_dropdown)
{
@ -175,7 +180,13 @@ class ListViewSmarty extends ListViewDisplay
&& ACLController::checkAccess('ProspectLists','edit',true)) {
$this->ss->assign( 'targetLink', $this->buildTargetList() ) ;
}
$this->processArrows($data['pageData']['ordering']);
if(!isset($data['pageData']['ordering'])) {
$GLOBALS['log']->warn("Incorrect pageData: ordering is not set");
} else {
$this->processArrows($data['pageData']['ordering']);
}
$this->ss->assign('prerow', $this->multiSelect);
$this->ss->assign('clearAll', $app_strings['LBL_CLEARALL']);
$this->ss->assign('rowColor', array('oddListRow', 'evenListRow'));
@ -235,7 +246,13 @@ class ListViewSmarty extends ListViewDisplay
$this->ss->assign('query', $this->data['query']);
$this->ss->assign('sugar_info', array("sugar_version" => $sugar_version,
"sugar_flavor" => $sugar_flavor));
$this->data['pageData']['offsets']['lastOffsetOnPage'] = $this->data['pageData']['offsets']['current'] + count($this->data['data']);
if(!isset($this->data['pageData']['offsets'])) {
$GLOBALS['log']->warn("Incorrect pageData: trying to display but offset is not set");
} else {
$this->data['pageData']['offsets']['lastOffsetOnPage'] = $this->data['pageData']['offsets']['current'] + count($this->data['data']);
}
$this->ss->assign('pageData', $this->data['pageData']);
$navStrings = array('next' => $app_strings['LNK_LIST_NEXT'],

File diff suppressed because it is too large Load diff

View file

@ -127,8 +127,9 @@ class ViewList extends SugarView
$metadataFile = $this->getMetaDataFile();
if (!file_exists($metadataFile))
sugar_die($GLOBALS['app_strings']['LBL_NO_ACTION']);
if (!file_exists($metadataFile)) {
sugar_die(sprintf($GLOBALS['app_strings']['LBL_NO_ACTION'], $this->do_action));
}
require($metadataFile);

View file

@ -78,7 +78,7 @@ class OutboundEmail {
var $mail_smtpauth_req; // bool
var $mail_smtpssl; // bool
var $mail_smtpdisplay; // calculated value, not in DB
var $new_with_id = FALSE;
var $new_with_id = false;
/**
* Sole constructor
@ -134,7 +134,7 @@ class OutboundEmail {
{
$ob = $this->getSystemMailerSettings();
$ob->id = create_guid();
$ob->new_with_id = TRUE;
$ob->new_with_id = true;
$ob->user_id = $user_id;
$ob->type = 'system-override';
$ob->mail_smtpuser = $user_name;
@ -153,7 +153,7 @@ class OutboundEmail {
*/
function doesUserOverrideAccountRequireCredentials($user_id)
{
$userCredentialsReq = FALSE;
$userCredentialsReq = false;
$sys = new OutboundEmail();
$ob = $sys->getSystemMailerSettings(); //Dirties '$this'
@ -163,7 +163,7 @@ class OutboundEmail {
$userOverideAccount = $this->getUsersMailerForSystemOverride($user_id);
if( $userOverideAccount == null || empty($userOverideAccount->mail_smtpuser) || empty($userOverideAccount->mail_smtpuser) )
$userCredentialsReq = TRUE;
$userCredentialsReq = true;
return $userCredentialsReq;
@ -172,73 +172,86 @@ class OutboundEmail {
/**
* Retrieves name value pairs for opts lists
*/
function getUserMailers($user) {
global $app_strings;
function getUserMailers($user)
{
global $app_strings;
$q = "SELECT * FROM outbound_email WHERE user_id = '{$user->id}' AND type = 'user' ORDER BY name";
$r = $this->db->query($q);
$q = "SELECT * FROM outbound_email WHERE user_id = '{$user->id}' AND type = 'user' ORDER BY name";
$r = $this->db->query($q);
$ret = array();
$ret = array();
$system = $this->getSystemMailerSettings();
$system = $this->getSystemMailerSettings();
//Now add the system default or user override default to the response.
if(!empty($system->id) )
{
if ($system->mail_sendtype == 'SMTP')
{
$systemErrors = "";
//Now add the system default or user override default to the response.
if (!empty($system->id)) {
if ($system->mail_sendtype == 'SMTP') {
$systemErrors = "";
$userSystemOverride = $this->getUsersMailerForSystemOverride($user->id);
//If the user is required to to provide a username and password but they have not done so yet,
//create the account for them.
$autoCreateUserSystemOverride = FALSE;
if( $this->doesUserOverrideAccountRequireCredentials($user->id) )
{
$systemErrors = $app_strings['LBL_EMAIL_WARNING_MISSING_USER_CREDS'];
$autoCreateUserSystemOverride = TRUE;
}
//create the account for them.
$autoCreateUserSystemOverride = false;
if ($this->doesUserOverrideAccountRequireCredentials($user->id)) {
$systemErrors = $app_strings['LBL_EMAIL_WARNING_MISSING_USER_CREDS'];
$autoCreateUserSystemOverride = true;
}
//Substitute in the users system override if its available.
if($userSystemOverride != null)
$system = $userSystemOverride;
else if ($autoCreateUserSystemOverride)
$system = $this->createUserSystemOverrideAccount($user->id,"","");
// Substitute in the users system override if its available.
if ($userSystemOverride != null) {
$system = $userSystemOverride;
} else {
if ($autoCreateUserSystemOverride) {
$system = $this->createUserSystemOverrideAccount($user->id, "", "");
}
}
// User overrides can be edited.
$isEditable = !($system->type == 'system' || $system->type == 'system-override');
$isEditable = ($system->type == 'system') ? FALSE : TRUE; //User overrides can be edited.
if (!empty($system->mail_smtpserver)) {
$ret[] = array(
'id' => $system->id,
'name' => "$system->name",
'mail_smtpserver' => $system->mail_smtpdisplay,
'is_editable' => $isEditable,
'type' => $system->type,
'errors' => $systemErrors
);
}
} else {
// use sendmail
$ret[] = array(
'id' => $system->id,
'name' => "{$system->name} - sendmail",
'mail_smtpserver' => 'sendmail',
'is_editable' => false,
'type' => $system->type,
'errors' => ''
);
}
}
if( !empty($system->mail_smtpserver) )
$ret[] = array('id' =>$system->id, 'name' => "$system->name", 'mail_smtpserver' => $system->mail_smtpdisplay,
'is_editable' => $isEditable, 'type' => $system->type, 'errors' => $systemErrors);
}
else //Sendmail
{
$ret[] = array('id' =>$system->id, 'name' => "{$system->name} - sendmail", 'mail_smtpserver' => 'sendmail',
'is_editable' => false, 'type' => $system->type, 'errors' => '');
}
}
while ($a = $this->db->fetchByAssoc($r)) {
$oe = array();
if ($a['mail_sendtype'] != 'SMTP') {
continue;
}
$oe['id'] = $a['id'];
$oe['name'] = $a['name'];
$oe['type'] = $a['type'];
$oe['is_editable'] = true;
$oe['errors'] = '';
if (!empty($a['mail_smtptype'])) {
$oe['mail_smtpserver'] = $this->_getOutboundServerDisplay($a['mail_smtptype'], $a['mail_smtpserver']);
} else {
$oe['mail_smtpserver'] = $a['mail_smtpserver'];
}
while($a = $this->db->fetchByAssoc($r))
{
$oe = array();
if($a['mail_sendtype'] != 'SMTP')
continue;
$ret[] = $oe;
}
$oe['id'] =$a['id'];
$oe['name'] = $a['name'];
$oe['type'] = $a['type'];
$oe['is_editable'] = true;
$oe['errors'] = '';
if ( !empty($a['mail_smtptype']) )
$oe['mail_smtpserver'] = $this->_getOutboundServerDisplay($a['mail_smtptype'],$a['mail_smtpserver']);
else
$oe['mail_smtpserver'] = $a['mail_smtpserver'];
$ret[] = $oe;
}
return $ret;
}
return $ret;
}
/**
* Retrieves a cascading mailer set
@ -302,6 +315,7 @@ class OutboundEmail {
return $results;
}
/**
* Retrieves a cascading mailer set
* @param object user
@ -353,7 +367,7 @@ class OutboundEmail {
*/
function isAllowUserAccessToSystemDefaultOutbound()
{
$allowAccess = FALSE;
$allowAccess = false;
// first check that a system default exists
$q = "SELECT id FROM outbound_email WHERE type = 'system'";
@ -362,10 +376,10 @@ class OutboundEmail {
if (!empty($a)) {
// next see if the admin preference for using the system outbound is set
$admin = new Administration();
$admin->retrieveSettings('',TRUE);
$admin->retrieveSettings('',true);
if (isset($admin->settings['notify_allow_default_outbound'])
&& $admin->settings['notify_allow_default_outbound'] == 2 )
$allowAccess = TRUE;
$allowAccess = true;
}
return $allowAccess;

View file

@ -735,7 +735,7 @@ class SearchForm
) {
require_once('include/SugarFields/SugarFieldHandler.php');
$sfh = new SugarFieldHandler();
$sf = $sfh->getSugarField('Parent');
$sf = $sfh::getSugarField('Parent');
$this->searchFields[$params['type_name']] = array('query_type' => 'default',
'value' => $sf->getSearchInput($params['type_name'], $array));

View file

@ -1,10 +1,11 @@
{*
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,10 +34,9 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>

View file

@ -1,10 +1,11 @@
{*
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,10 +34,9 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
<script type="text/javascript" src='{sugar_getjspath file="include/SugarFields/Fields/Address/SugarFieldAddress.js"}'></script>
{{assign var="key" value=$displayParams.key|upper}}

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
* SugarFieldBase translates and displays fields from a vardef definition into different formats
@ -43,77 +48,104 @@
* to handle searching
*
*/
class SugarFieldBase {
var $ss; // Sugar Smarty Object
var $hasButton = false;
function __construct($type) {
$this->type = $type;
class SugarFieldBase
{
/**
* @var Sugar_Smarty $ss
*/
public $ss;
/**
* @var bool $hasButton;
*/
public $hasButton = false;
/**
* SugarFieldBase constructor.
* @param $type
*/
public function __construct($type)
{
$this->type = $type;
$this->ss = new Sugar_Smarty();
}
/**
* @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
* @param $type
*/
function SugarFieldBase($type){
public function SugarFieldBase($type)
{
$deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
if(isset($GLOBALS['log'])) {
if (isset($GLOBALS['log'])) {
$GLOBALS['log']->deprecated($deprecatedMessage);
}
else {
} else {
trigger_error($deprecatedMessage, E_USER_DEPRECATED);
}
self::__construct($type);
}
function fetch($path){
$additional = '';
if(!$this->hasButton && !empty($this->button)){
$additional .= '<input type="button" class="button" ' . $this->button . '>';
}
if(!empty($this->buttons)){
foreach($this->buttons as $v){
/**
* parse and fetch template
* @param string $path template
* @return string
*/
public function fetch($path)
{
$additional = '';
if (!$this->hasButton && !empty($this->button)) {
$additional .= '<input type="button" class="button" ' . $this->button . '>';
}
if (!empty($this->buttons)) {
foreach ($this->buttons as $v) {
$additional .= ' <input type="button" class="button" ' . $v . '>';
}
}
if(!empty($this->image)){
if (!empty($this->image)) {
$additional .= ' <img ' . $this->image . '>';
}
return $this->ss->fetch($path) . $additional;
return $this->ss->fetch($path) . $additional;
}
function findTemplate($view){
/**
* @param string $view Eg EditView
* @return string
*/
public function findTemplate($view)
{
static $tplCache = array();
if ( isset($tplCache[$this->type][$view]) ) {
if (isset($tplCache[$this->type][$view])) {
return $tplCache[$this->type][$view];
}
$lastClass = get_class($this);
$classList = array($this->type,str_replace('SugarField','',$lastClass));
while ( $lastClass = get_parent_class($lastClass) ) {
$classList[] = str_replace('SugarField','',$lastClass);
$classList = array($this->type, str_replace('SugarField', '', $lastClass));
while ($lastClass = get_parent_class($lastClass)) {
$classList[] = str_replace('SugarField', '', $lastClass);
}
$tplName = '';
foreach ( $classList as $className ) {
foreach ($classList as $className) {
global $current_language;
if(isset($current_language)) {
$tplName = 'include/SugarFields/Fields/'. $className .'/'. $current_language . '.' . $view .'.tpl';
if ( file_exists('custom/'.$tplName) ) {
$tplName = 'custom/'.$tplName;
if (isset($current_language)) {
$tplName = 'include/SugarFields/Fields/' . $className . '/' . $current_language . '.' . $view . '.tpl';
if (file_exists('custom/' . $tplName)) {
$tplName = 'custom/' . $tplName;
break;
}
if ( file_exists($tplName) ) {
if (file_exists($tplName)) {
break;
}
}
$tplName = 'include/SugarFields/Fields/'. $className .'/'. $view .'.tpl';
if ( file_exists('custom/'.$tplName) ) {
$tplName = 'custom/'.$tplName;
$tplName = 'include/SugarFields/Fields/' . $className . '/' . $view . '.tpl';
if (file_exists('custom/' . $tplName)) {
$tplName = 'custom/' . $tplName;
break;
}
if ( file_exists($tplName) ) {
if (file_exists($tplName)) {
break;
}
}
@ -123,48 +155,73 @@ class SugarFieldBase {
return $tplName;
}
public function formatField($rawField, $vardef){
/**
* @param array $rawField
* @param array $vardef
* @return mixed
*/
public function formatField($rawField, $vardef)
{
// The base field doesn't do any formatting, so override it in subclasses for more specific actions
return $rawField;
}
public function unformatField($formattedField, $vardef){
/**
* @param array $rawField
* @param array $vardef
* @return mixed
*/
public function unformatField($formattedField, $vardef)
{
// The base field doesn't do any formatting, so override it in subclasses for more specific actions
return $formattedField;
}
function getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, $view){
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @param string $view
* @return string
*/
public function getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, $view)
{
// set $tabindex = -1 by default
if(!is_numeric($tabindex)) {
if (!is_numeric($tabindex)) {
$tabindex = -1;
}
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate($view));
return $this->fetch($this->findTemplate($view));
}
function getListViewSmarty($parentFieldArray, $vardef, $displayParams, $col) {
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param string $col (unused)
* @return string
*/
public function getListViewSmarty($parentFieldArray, $vardef, $displayParams, $col)
{
$tabindex = 1;
//fixing bug #46666: don't need to format enum and radioenum fields
//because they are already formated in SugarBean.php in the function get_list_view_array() as fix of bug #21672
if ($this->type != 'Enum' && $this->type != 'Radioenum')
{
if ($this->type != 'Enum' && $this->type != 'Radioenum') {
$parentFieldArray = $this->setupFieldArray($parentFieldArray, $vardef);
}
else
{
$vardef['name'] = strtoupper($vardef['name']);
} else {
$vardef['name'] = strtoupper($vardef['name']);
}
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex, false);
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex, false);
$this->ss->left_delimiter = '{';
$this->ss->right_delimiter = '}';
$this->ss->assign('col',$vardef['name']);
$this->ss->assign('col', $vardef['name']);
return $this->fetch($this->findTemplate('ListView'));
}
@ -172,68 +229,123 @@ class SugarFieldBase {
/**
* Returns a smarty template for the DetailViews
*
* @param parentFieldArray string name of the variable in the parent template for the bean's data
* @param vardef vardef field defintion
* @param displayParam parameters for display
* @param array $parentFieldArray string name of the variable in the parent template for the bean's data
* @param array $vardef field defintion
* @param array $displayParam parameters for display
* available paramters are:
* * labelSpan - column span for the label
* * fieldSpan - column span for the field
* @param integer $tabindex
* @returns string
*/
function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
public function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
return $this->getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, 'DetailView');
}
// 99% of all fields will just format like a listview, but just in case, it's here to override
function getChangeLogSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
return $this->formatField($parentFieldArray[$vardef['name']],$vardef);
/**
* 99% of all fields will just format like a listview, but just in case, it's here to override
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return mixed
*/
public function getChangeLogSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
return $this->formatField($parentFieldArray[$vardef['name']], $vardef);
}
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
if (!empty($vardef['function']['returns']) && $vardef['function']['returns'] == 'html') {
$type = $this->type;
$this->type = 'Base';
$result = $this->getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
$this->type = $type;
function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
if(!empty($vardef['function']['returns']) && $vardef['function']['returns'] == 'html'){
$type = $this->type;
$this->type = 'Base';
$result= $this->getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
$this->type = $type;
return $result;
}
// jpereira@dri - #Bug49513 - Readonly type not working as expected
// If readonly is set in displayParams, the vardef will be displayed as in DetailView.
if (isset($displayParams['readonly']) && $displayParams['readonly']) {
return $this->getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, 'DetailView');
}
// ~ jpereira@dri - #Bug49513 - Readonly type not working as expected
return $this->getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, 'EditView');
return $result;
}
// jpereira@dri - #Bug49513 - Readonly type not working as expected
// If readonly is set in displayParams, the vardef will be displayed as in DetailView.
if (isset($displayParams['readonly']) && $displayParams['readonly']) {
return $this->getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, 'DetailView');
}
// ~ jpereira@dri - #Bug49513 - Readonly type not working as expected
return $this->getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, 'EditView');
}
function getImportViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getImportViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
return $this->getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
}
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
if (!empty($vardef['auto_increment'])) {
$vardef['len'] = 255;
}
return $this->getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, 'EditView');
}
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getPopupViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
if (is_array($displayParams) && !isset($displayParams['formName'])) {
$displayParams['formName'] = 'popup_query_form';
} else {
if (empty($displayParams)) {
$displayParams = array('formName' => 'popup_query_form');
}
}
function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
if(!empty($vardef['auto_increment']))$vardef['len']=255;
return $this->getSmartyView($parentFieldArray, $vardef, $displayParams, $tabindex, 'EditView');
return $this->getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
}
function getPopupViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex){
if (is_array($displayParams) && !isset($displayParams['formName']))
$displayParams['formName'] = 'popup_query_form';
else if (empty($displayParams))
$displayParams = array('formName' => 'popup_query_form');
return $this->getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
}
public function getEmailTemplateValue($inputField, $vardef, $context = null){
/**
* @param array $inputField
* @param array $vardef
* @param null $context
* @return mixed
*/
public function getEmailTemplateValue($inputField, $vardef, $context = null)
{
// This does not return a smarty section, instead it returns a direct value
return $this->formatField($inputField,$vardef);
return $this->formatField($inputField, $vardef);
}
function displayFromFunc( $displayType, $parentFieldArray, $vardef, $displayParams, $tabindex = 0 ) {
public function displayFromFunc($displayType, $parentFieldArray, $vardef, $displayParams, $tabindex = 0)
{
if ( ! is_array($vardef['function']) ) {
if (!is_array($vardef['function'])) {
$funcName = $vardef['function'];
$includeFile = '';
$onListView = false;
@ -241,57 +353,61 @@ class SugarFieldBase {
} else {
$funcName = $vardef['function']['name'];
$includeFile = '';
if ( isset($vardef['function']['include']) ) {
if (isset($vardef['function']['include'])) {
$includeFile = $vardef['function']['include'];
}
if ( isset($vardef['function']['onListView']) && $vardef['function']['onListView'] == true ) {
if (isset($vardef['function']['onListView']) && $vardef['function']['onListView'] == true) {
$onListView = true;
} else {
$onListView = false;
}
if ( isset($vardef['function']['returns']) && $vardef['function']['returns'] == 'html' ) {
if (isset($vardef['function']['returns']) && $vardef['function']['returns'] == 'html') {
$returnsHtml = true;
} else {
$returnsHtml = false;
}
}
if ( $displayType == 'ListView'
|| $displayType == 'popupView'
|| $displayType == 'searchView'
) {
if ($displayType === 'ListView'
|| $displayType === 'popupView'
|| $displayType === 'searchView'
) {
// Traditionally, before 6.0, additional functions were never called, so this code doesn't get called unless the vardef forces it
if ( $onListView ) {
if ( !empty($includeFile) ) {
if ($onListView) {
if (!empty($includeFile)) {
require_once($includeFile);
}
return $funcName($parentFieldArray, $vardef['name'], $parentFieldArray[strtoupper($vardef['name'])], $displayType);
return $funcName($parentFieldArray, $vardef['name'], $parentFieldArray[strtoupper($vardef['name'])],
$displayType);
} else {
$displayTypeFunc = 'get'.$displayType.'Smarty';
$displayTypeFunc = 'get' . $displayType . 'Smarty';
return $this->$displayTypeFunc($parentFieldArray, $vardef, $displayParams, $tabindex);
}
} else {
if ( !empty($displayParams['idName']) ) {
if (!empty($displayParams['idName'])) {
$fieldName = $displayParams['idName'];
} else {
$fieldName = $vardef['name'];
}
if ( $returnsHtml ) {
if ($returnsHtml) {
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
$tpl = $this->findTemplate($displayType.'Function');
if ( $tpl == '' ) {
$tpl = $this->findTemplate($displayType . 'Function');
if ($tpl === '') {
// Can't find a function template, just use the base
$tpl = $this->findTemplate('DetailViewFunction');
}
return "<span id='{$vardef['name']}_span'>" . $this->fetch($tpl) . '</span>';
} else {
return '{sugar_run_helper include="'.$includeFile.'" func="'.$funcName.'" bean=$bean field="'.$fieldName.'" value=$fields.'.$fieldName.'.value displayType="'.$displayType.'"}';
return '{sugar_run_helper include="' . $includeFile . '" func="' . $funcName . '" bean=$bean field="' . $fieldName . '" value=$fields.' . $fieldName . '.value displayType="' . $displayType . '"}';
}
}
}
function getEditView() {
public function getEditView()
{
}
/**
@ -303,7 +419,8 @@ class SugarFieldBase {
* @param $value Mixed value being searched on
* @return Mixed the value for the where clause used in search
*/
function getSearchWhereValue($value) {
public function getSearchWhereValue($value)
{
return $value;
}
@ -317,38 +434,42 @@ class SugarFieldBase {
* @param $args Mixed value containing haystack to search for value in
* @return $value Mixed value that the SugarField should return
*/
function getSearchInput($key='', $args=array())
public function getSearchInput($key = '', $args = array())
{
//Nothing specified return empty string
if(empty($key) || empty($args))
{
return '';
}
//Nothing specified return empty string
if (empty($key) || empty($args)) {
return '';
}
return isset($args[$key]) ? $args[$key] : '';
return isset($args[$key]) ? $args[$key] : '';
}
function getQueryLike() {
public function getQueryLike()
{
}
function getQueryIn() {
public function getQueryIn()
{
}
/**
* Setup function to assign values to the smarty template, should be called before every display function
* @param $parentFieldArray
* @param $vardef
* @param $displayParams
* @param $tabindex
* @param bool $twopass
*/
function setup($parentFieldArray, $vardef, $displayParams, $tabindex, $twopass=true) {
$this->button = '';
$this->buttons = '';
$this->image = '';
if ($twopass)
{
public function setup($parentFieldArray, $vardef, $displayParams, $tabindex, $twopass = true)
{
$this->button = '';
$this->buttons = '';
$this->image = '';
if ($twopass) {
$this->ss->left_delimiter = '{{';
$this->ss->right_delimiter = '}}';
}
else
{
} else {
$this->ss->left_delimiter = '{';
$this->ss->right_delimiter = '}';
}
@ -358,35 +479,35 @@ class SugarFieldBase {
//for adding attributes to the field
if(!empty($displayParams['field'])){
$plusField = '';
foreach($displayParams['field'] as $key=>$value){
$plusField .= ' ' . $key . '="' . $value . '"';//bug 27381
}
$displayParams['field'] = $plusField;
if (!empty($displayParams['field'])) {
$plusField = '';
foreach ($displayParams['field'] as $key => $value) {
$plusField .= ' ' . $key . '="' . $value . '"';//bug 27381
}
$displayParams['field'] = $plusField;
}
//for adding attributes to the button
if(!empty($displayParams['button'])){
$plusField = '';
foreach($displayParams['button'] as $key=>$value){
$plusField .= ' ' . $key . '="' . $value . '"';
}
$displayParams['button'] = $plusField;
$this->button = $displayParams['button'];
}
if(!empty($displayParams['buttons'])){
if (!empty($displayParams['button'])) {
$plusField = '';
foreach($displayParams['buttons'] as $keys=>$values){
foreach($values as $key=>$value){
foreach ($displayParams['button'] as $key => $value) {
$plusField .= ' ' . $key . '="' . $value . '"';
}
$displayParams['button'] = $plusField;
$this->button = $displayParams['button'];
}
if (!empty($displayParams['buttons'])) {
$plusField = '';
foreach ($displayParams['buttons'] as $keys => $values) {
foreach ($values as $key => $value) {
$plusField[$keys] .= ' ' . $key . '="' . $value . '"';
}
}
$displayParams['buttons'] = $plusField;
$this->buttons = $displayParams['buttons'];
}
if(!empty($displayParams['image'])){
if (!empty($displayParams['image'])) {
$plusField = '';
foreach($displayParams['image'] as $key=>$value){
foreach ($displayParams['image'] as $key => $value) {
$plusField .= ' ' . $key . '="' . $value . '"';
}
$displayParams['image'] = $plusField;
@ -397,7 +518,8 @@ class SugarFieldBase {
}
protected function getAccessKey($vardef, $fieldType = null, $module = null) {
protected function getAccessKey($vardef, $fieldType = null, $module = null)
{
global $app_strings;
$labelList = array(
@ -407,41 +529,41 @@ class SugarFieldBase {
);
// Labels are always in uppercase
if ( isset($fieldType) ) {
if (isset($fieldType)) {
$fieldType = strtoupper($fieldType);
}
if ( isset($module) ) {
if (isset($module)) {
$module = strtoupper($module);
}
// The vardef is the most specific, then the module + fieldType, then the module, then the fieldType
if ( isset($vardef['accessKey']) ) {
if (isset($vardef['accessKey'])) {
$labelList['accessKey'][] = $vardef['accessKey'];
}
if ( isset($vardef['accessKeySelect']) ) {
if (isset($vardef['accessKeySelect'])) {
$labelList['accessKeySelect'][] = $vardef['accessKeySelect'];
}
if ( isset($vardef['accessKeyClear']) ) {
if (isset($vardef['accessKeyClear'])) {
$labelList['accessKeyClear'][] = $vardef['accessKeyClear'];
}
if ( isset($fieldType) && isset($module) ) {
$labelList['accessKey'][] = 'LBL_ACCESSKEY_'.$fieldType.'_'.$module;
$labelList['accessKeySelect'][] = 'LBL_ACCESSKEY_SELECT_'.$fieldType.'_'.$module;
$labelList['accessKeyClear'][] = 'LBL_ACCESSKEY_CLEAR_'.$fieldType.'_'.$module;
if (isset($fieldType) && isset($module)) {
$labelList['accessKey'][] = 'LBL_ACCESSKEY_' . $fieldType . '_' . $module;
$labelList['accessKeySelect'][] = 'LBL_ACCESSKEY_SELECT_' . $fieldType . '_' . $module;
$labelList['accessKeyClear'][] = 'LBL_ACCESSKEY_CLEAR_' . $fieldType . '_' . $module;
}
if ( isset($module) ) {
$labelList['accessKey'][] = 'LBL_ACCESSKEY_'.$module;
$labelList['accessKeySelect'][] = 'LBL_ACCESSKEY_SELECT_'.$module;
$labelList['accessKeyClear'][] = 'LBL_ACCESSKEY_CLEAR_'.$module;
if (isset($module)) {
$labelList['accessKey'][] = 'LBL_ACCESSKEY_' . $module;
$labelList['accessKeySelect'][] = 'LBL_ACCESSKEY_SELECT_' . $module;
$labelList['accessKeyClear'][] = 'LBL_ACCESSKEY_CLEAR_' . $module;
}
if ( isset($fieldType) ) {
$labelList['accessKey'][] = 'LBL_ACCESSKEY_'.$fieldType;
$labelList['accessKeySelect'][] = 'LBL_ACCESSKEY_SELECT_'.$fieldType;
$labelList['accessKeyClear'][] = 'LBL_ACCESSKEY_CLEAR_'.$fieldType;
if (isset($fieldType)) {
$labelList['accessKey'][] = 'LBL_ACCESSKEY_' . $fieldType;
$labelList['accessKeySelect'][] = 'LBL_ACCESSKEY_SELECT_' . $fieldType;
$labelList['accessKeyClear'][] = 'LBL_ACCESSKEY_CLEAR_' . $fieldType;
}
// Attach the defaults to the ends
@ -451,7 +573,7 @@ class SugarFieldBase {
// Figure out the label and the key for the button.
// Later on we may attempt to make sure there are no two buttons with the same keys, but for now we will just use whatever is specified.
$keyTypes = array('accessKey','accessKeySelect','accessKeyClear');
$keyTypes = array('accessKey', 'accessKeySelect', 'accessKeyClear');
$accessKeyList = array(
'accessKey' => '',
'accessKeyLabel' => '',
@ -463,12 +585,12 @@ class SugarFieldBase {
'accessKeyClearLabel' => '',
'accessKeyClearTitle' => '',
);
foreach( $keyTypes as $type ) {
foreach ( $labelList[$type] as $tryThis ) {
if ( isset($app_strings[$tryThis.'_KEY']) && isset($app_strings[$tryThis.'_TITLE']) && isset($app_strings[$tryThis.'_LABEL']) ) {
$accessKeyList[$type] = $tryThis.'_KEY';
$accessKeyList[$type.'Title'] = $tryThis.'_TITLE';
$accessKeyList[$type.'Label'] = $tryThis.'_LABEL';
foreach ($keyTypes as $type) {
foreach ($labelList[$type] as $tryThis) {
if (isset($app_strings[$tryThis . '_KEY']) && isset($app_strings[$tryThis . '_TITLE']) && isset($app_strings[$tryThis . '_LABEL'])) {
$accessKeyList[$type] = $tryThis . '_KEY';
$accessKeyList[$type . 'Title'] = $tryThis . '_TITLE';
$accessKeyList[$type . 'Label'] = $tryThis . '_LABEL';
break;
}
}
@ -477,31 +599,32 @@ class SugarFieldBase {
return $accessKeyList;
}
/**
/**
* This should be called when the bean is saved. The bean itself will be passed by reference
* @param SugarBean bean - the bean performing the save
* @param array params - an array of paramester relevant to the save, most likely will be $_REQUEST
*/
public function save(&$bean, $params, $field, $properties, $prefix = '') {
if ( isset($params[$prefix.$field]) ) {
if(isset($properties['len']) && isset($properties['type']) && $this->isTrimmable($properties['type'])){
$bean->$field = trim($this->unformatField($params[$prefix.$field], $properties));
}
else {
$bean->$field = $this->unformatField($params[$prefix.$field], $properties);
}
}
}
public function save(&$bean, $params, $field, $properties, $prefix = '')
{
if (isset($params[$prefix . $field])) {
if (isset($properties['len']) && isset($properties['type']) && $this->isTrimmable($properties['type'])) {
$bean->$field = trim($this->unformatField($params[$prefix . $field], $properties));
} else {
$bean->$field = $this->unformatField($params[$prefix . $field], $properties);
}
}
}
/**
* Check if the field is allowed to be trimmed
*
* @param string $type
* @return boolean
*/
protected function isTrimmable($type) {
return in_array($type, array('varchar', 'name'));
}
/**
* Check if the field is allowed to be trimmed
*
* @param string $type
* @return boolean
*/
protected function isTrimmable($type)
{
return in_array($type, array('varchar', 'name'));
}
/**
* Handles import field sanitizing for an field type
@ -517,9 +640,8 @@ class SugarFieldBase {
$vardef,
$focus,
ImportFieldSanitize $settings
)
{
if( isset($vardef['len']) ) {
) {
if (isset($vardef['len'])) {
// check for field length
$value = sugar_substr($value, $vardef['len']);
}
@ -535,7 +657,7 @@ class SugarFieldBase {
*/
protected function isRangeSearchView($vardef)
{
return !empty($vardef['enable_range_search']) && !empty($_REQUEST['action']) && $_REQUEST['action']!='Popup';
return !empty($vardef['enable_range_search']) && !empty($_REQUEST['action']) && $_REQUEST['action'] != 'Popup';
}
/**
@ -544,32 +666,30 @@ class SugarFieldBase {
* to call any custom fieldSpecific formatting to the value depending on the field type.
*
* @see SugarFieldEnum.php, SugarFieldInt.php, SugarFieldFloat.php, SugarFieldRelate.php
* @param mixed $parentFieldArray Array or Object of data where the field's value comes from
* @param array $vardef The vardef entry linked to the SugarField instance
* @return array $parentFieldArray The formatted $parentFieldArray with the formatField method possibly applied
* @param mixed $parentFieldArray Array or Object of data where the field's value comes from
* @param array $vardef The vardef entry linked to the SugarField instance
* @return array $parentFieldArray The formatted $parentFieldArray with the formatField method possibly applied
*/
protected function setupFieldArray($parentFieldArray, $vardef)
{
$fieldName = $vardef['name'];
if ( is_array($parentFieldArray) )
{
if (is_array($parentFieldArray)) {
$fieldNameUpper = strtoupper($fieldName);
if ( isset($parentFieldArray[$fieldNameUpper]))
{
$parentFieldArray[$fieldName] = $this->formatField($parentFieldArray[$fieldNameUpper],$vardef);
if (isset($parentFieldArray[$fieldNameUpper])) {
$parentFieldArray[$fieldName] = $this->formatField($parentFieldArray[$fieldNameUpper], $vardef);
} else {
$parentFieldArray[$fieldName] = '';
}
} elseif (is_object($parentFieldArray)) {
if ( isset($parentFieldArray->$fieldName) )
{
$parentFieldArray->$fieldName = $this->formatField($parentFieldArray->$fieldName,$vardef);
if (isset($parentFieldArray->$fieldName)) {
$parentFieldArray->$fieldName = $this->formatField($parentFieldArray->$fieldName, $vardef);
} else {
$parentFieldArray->$fieldName = '';
}
}
return $parentFieldArray;
}
}
?>

View file

@ -38,7 +38,7 @@
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
<span class="sugar_field" id="{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}">{{sugarvar key='value'}}</span>
<span class="sugar_field" id="{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}">{{$vardef.value}}</span>
{{if !empty($displayParams.enableConnectors)}}
{{sugarvar_connector view='DetailView'}}
{{/if}}

View file

@ -42,21 +42,24 @@ require_once('include/SugarFields/Fields/Base/SugarFieldBase.php');
class SugarFieldHtml extends SugarFieldBase {
function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex){
$vardef['value'] = $this->getVardefValue($vardef);
$sugarCleaner = new SugarCleaner();
$vardef['value'] = $sugarCleaner::cleanHtml($this->getVardefValue($vardef));
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('DetailView'));
}
function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex){
$vardef['value'] = $this->getVardefValue($vardef);
$sugarCleaner = new SugarCleaner();
$vardef['value'] = $sugarCleaner::cleanHtml($this->getVardefValue($vardef));
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('DetailView'));
}
function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
$vardef['value'] = $this->getVardefValue($vardef);
$sugarCleaner = new SugarCleaner();
$vardef['value'] = $sugarCleaner::cleanHtml($this->getVardefValue($vardef));
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('DetailView'));

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,57 +34,92 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once('include/SugarFields/Fields/Relate/SugarFieldRelate.php');
class SugarFieldParent extends SugarFieldRelate {
function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
$nolink = array('Users', 'Teams');
if(in_array($vardef['module'], $nolink)){
$this->ss->assign('nolink', true);
}else{
$this->ss->assign('nolink', false);
}
class SugarFieldParent extends SugarFieldRelate
{
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
$nolink = array('Users', 'Teams');
if (in_array($vardef['module'], $nolink)) {
$this->ss->assign('nolink', true);
} else {
$this->ss->assign('nolink', false);
}
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('DetailView'));
}
function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
$form_name = 'EditView';
if(isset($displayParams['formName'])) {
$form_name = $displayParams['formName'];
}
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => $form_name,
'field_to_name_array' => array(
'id' => $vardef['id_name'],
'name' => $vardef['name'],
),
);
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
global $app_list_strings;
global $focus;
$form_name = 'EditView';
if (isset($displayParams['formName'])) {
$form_name = $displayParams['formName'];
}
global $app_list_strings;
$parent_types = $app_list_strings['record_type_display'];
$disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
foreach($disabled_parent_types as $disabled_parent_type){
if($disabled_parent_type != $focus->parent_type){
unset($parent_types[$disabled_parent_type]);
}
}
asort($parent_types);
$json = getJSONobj();
$displayParams['popupData'] = '{literal}'.$json->encode($popup_request_data).'{/literal}';
$displayParams['disabled_parent_types'] = '<script>var disabledModules='. $json->encode($disabled_parent_types).';</script>';
$this->ss->assign('quickSearchCode', $this->createQuickSearchCode($form_name, $vardef));
$popup_request_data = array();
$keys = $this->getAccessKey($vardef,'PARENT',$vardef['module']);
if (isset($displayParams['call_back_function']) && !empty($displayParams['call_back_function'])) {
$popup_request_data['call_back_function'] = $displayParams['call_back_function'];
} else {
$popup_request_data['call_back_function'] = 'set_return';
}
$popup_request_data['form_name'] = $form_name;
$popup_request_data['field_to_name_array'] = array(
'id' => $vardef['id_name'],
'name' => $vardef['name'],
);
if (isset($displayParams['field_to_name_array']) && !empty($displayParams['field_to_name_array'])) {
$popup_request_data['field_to_name_array'] = array_merge(
$popup_request_data['field_to_name_array'],
$displayParams['field_to_name_array']
);
}
$parent_types = $app_list_strings['record_type_display'];
$disabled_parent_types = ACLController::disabledModuleList($parent_types, false, 'list');
foreach ($disabled_parent_types as $disabled_parent_type) {
if ($disabled_parent_type != $focus->parent_type) {
unset($parent_types[$disabled_parent_type]);
}
}
asort($parent_types);
$json = getJSONobj();
$displayParams['popupData'] = '{literal}' . $json::encode($popup_request_data) . '{/literal}';
$displayParams['disabled_parent_types'] = '<script>var disabledModules=' . $json::encode($disabled_parent_types) . ';</script>';
$this->ss->assign('quickSearchCode', $this->createQuickSearchCode($form_name, $vardef));
$keys = $this->getAccessKey($vardef, 'PARENT', $vardef['module']);
$displayParams['accessKeySelect'] = $keys['accessKeySelect'];
$displayParams['accessKeySelectLabel'] = $keys['accessKeySelectLabel'];
$displayParams['accessKeySelectTitle'] = $keys['accessKeySelectTitle'];
@ -91,127 +127,144 @@ class SugarFieldParent extends SugarFieldRelate {
$displayParams['accessKeyClearLabel'] = $keys['accessKeyClearLabel'];
$displayParams['accessKeyClearTitle'] = $keys['accessKeyClearTitle'];
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('EditView'));
}
function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
$form_name = 'search_form';
if(isset($displayParams['formName'])) {
$form_name = $displayParams['formName'];
}
if(preg_match('/(_basic|_advanced)$/', $vardef['name'], $match))
{
$vardef['type_name'] = $vardef['type_name'] . $match[1];
}
$this->ss->assign('form_name', $form_name);
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => $form_name,
'field_to_name_array' => array(
'id' => $vardef['id_name'],
'name' => $vardef['name'],
),
);
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
global $app_list_strings;
global $focus;
$form_name = 'search_form';
global $app_list_strings;
$parent_types = $app_list_strings['record_type_display'];
$disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
foreach($disabled_parent_types as $disabled_parent_type){
if($disabled_parent_type != $focus->parent_type){
unset($parent_types[$disabled_parent_type]);
}
}
if (isset($displayParams['formName'])) {
$form_name = $displayParams['formName'];
}
if (preg_match('/(_basic|_advanced)$/', $vardef['name'], $match)) {
$vardef['type_name'] .= $match[1];
}
$this->ss->assign('form_name', $form_name);
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => $form_name,
'field_to_name_array' => array(
'id' => $vardef['id_name'],
'name' => $vardef['name'],
),
);
$parent_types = $app_list_strings['record_type_display'];
$disabled_parent_types = ACLController::disabledModuleList($parent_types, false, 'list');
foreach ($disabled_parent_types as $disabled_parent_type) {
if ($disabled_parent_type !== $focus->parent_type) {
unset($parent_types[$disabled_parent_type]);
}
}
$json = getJSONobj();
$displayParams['popupData'] = '{literal}' . $json::encode($popup_request_data) . '{/literal}';
$displayParams['disabled_parent_types'] = '<script>var disabledModules=' . $json::encode($disabled_parent_types) . ';</script>';
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
$json = getJSONobj();
$displayParams['popupData'] = '{literal}'.$json->encode($popup_request_data).'{/literal}';
$displayParams['disabled_parent_types'] = '<script>var disabledModules='. $json->encode($disabled_parent_types).';</script>';
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('SearchView'));
}
/**
* @see SugarFieldBase::importSanitize()
* @param string $value
* @param array $vardef
* @param SugarBean $focus
* @param ImportFieldSanitize $settings
* @return array|bool|string
*/
public function importSanitize(
$value,
$vardef,
$focus,
ImportFieldSanitize $settings
)
{
) {
global $beanList;
if ( isset($vardef['type_name']) ) {
if (isset($vardef['type_name'])) {
$moduleName = $vardef['type_name'];
if ( isset($focus->$moduleName) && isset($beanList[$focus->$moduleName]) ) {
if (isset($focus->$moduleName) && isset($beanList[$focus->$moduleName])) {
$vardef['module'] = $focus->$moduleName;
$vardef['rname'] = 'name';
$relatedBean = loadBean($focus->$moduleName);
$vardef['table'] = $relatedBean->table_name;
return parent::importSanitize($value,$vardef,$focus,$settings);
return parent::importSanitize($value, $vardef, $focus, $settings);
}
}
return false;
}
function createQuickSearchCode($formName = 'EditView', $vardef = array()){
/**
* @param string $formName
* @param array $vardef
* @return string
*/
public function createQuickSearchCode($formName = 'EditView', $vardef = array())
{
require_once('include/QuickSearchDefaults.php');
$json = getJSONobj();
$dynamicParentTypePlaceHolder = "**@**"; //Placeholder for dynamic parent so smarty tags are not escaped in json encoding.
$dynamicParentType = '{/literal}{if !empty($fields.parent_type.value)}{$fields.parent_type.value}{else}Accounts{/if}{literal}';
//Get the parent sqs definition
$qsd = QuickSearchDefaults::getQuickSearchDefaults();
$qsd->setFormName($formName);
$sqsFieldArray = $qsd->getQSParent($dynamicParentTypePlaceHolder);
$qsFieldName = $formName . "_" . $vardef['name'];
//Build the javascript
$quicksearch_js = '<script language="javascript">';
$quicksearch_js.= "if(typeof sqs_objects == 'undefined'){var sqs_objects = new Array;}";
$quicksearch_js .= "sqs_objects['$qsFieldName']=" . str_replace($dynamicParentTypePlaceHolder, $dynamicParentType,$json->encode($sqsFieldArray)) .';';
return $quicksearch_js .= '</script>';
$quicksearch_js .= "if(typeof sqs_objects == 'undefined'){var sqs_objects = new Array;}";
$quicksearch_js .= "sqs_objects['$qsFieldName']=" . str_replace($dynamicParentTypePlaceHolder,
$dynamicParentType, $json::encode($sqsFieldArray)) . ';';
$quicksearch_js .= '</script>';
return $quicksearch_js;
}
/**
* getSearchInput
*
* This function allows the SugarFields to handle returning the search input value given arguments (typically from $_REQUEST/$_POST)
* and a search string.
*
* @param $key String value of key to search for
* @param $args Mixed value containing haystack to search for value in
* @return $value Mixed value that the SugarField should return
*/
function getSearchInput($key='', $args=array())
*
* @param string $key value of key to search for
* @param array $args value containing haystack to search for value in
* @return mixed|string value that the SugarField should return
*/
public function getSearchInput($key = '', $args = array())
{
//Nothing specified return empty string
if(empty($key) || empty($args))
{
return '';
}
//We are probably getting "parent_type" as the $key value, but this is likely not set since there are
//advanced and basic tabs. This next section attempts to resolve this issue.
$isBasicSearch = isset($args['searchFormTab']) && $args['searchFormTab'] == 'basic_search' ? true : false;
$searchKey = $isBasicSearch ? "{$key}_basic" : "{$key}_advanced";
if(isset($args[$searchKey]))
{
return $args[$searchKey];
}
return isset($args[$key]) ? $args[$key] : '';
}
}
?>
//Nothing specified return empty string
if (empty($key) || empty($args)) {
return '';
}
//We are probably getting "parent_type" as the $key value, but this is likely not set since there are
//advanced and basic tabs. This next section attempts to resolve this issue.
$isBasicSearch = isset($args['searchFormTab']) && $args['searchFormTab'] === 'basic_search' ? true : false;
$searchKey = $isBasicSearch ? "{$key}_basic" : "{$key}_advanced";
if (isset($args[$searchKey])) {
return $args[$searchKey];
}
return isset($args[$key]) ? $args[$key] : '';
}
}

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,45 +34,63 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once('include/SugarFields/Fields/Base/SugarFieldBase.php');
class SugarFieldRelate extends SugarFieldBase {
class SugarFieldRelate extends SugarFieldBase
{
function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
/**
* @param string $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getDetailViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
$nolink = array('Users', 'Teams');
if(in_array($vardef['module'], $nolink)){
if (in_array($vardef['module'], $nolink)) {
$this->ss->assign('nolink', true);
}else{
} else {
$this->ss->assign('nolink', false);
}
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('DetailView'));
}
/**
* @see SugarFieldBase::getEditViewSmarty()
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
if(!empty($vardef['function']['returns']) && $vardef['function']['returns'] == 'html'){
if (!empty($vardef['function']['returns']) && $vardef['function']['returns'] === 'html') {
return parent::getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
}
$call_back_function = 'set_return';
if(isset($displayParams['call_back_function'])) {
if (isset($displayParams['call_back_function'])) {
$call_back_function = $displayParams['call_back_function'];
}
$form_name = 'EditView';
if(isset($displayParams['formName'])) {
if (isset($displayParams['formName'])) {
$form_name = $displayParams['formName'];
}
if (isset($displayParams['idName']))
{
if (isset($displayParams['idName'])) {
$rpos = strrpos($displayParams['idName'], $vardef['name']);
$displayParams['idNameHidden'] = substr($displayParams['idName'], 0, $rpos);
}
@ -79,24 +98,25 @@ class SugarFieldRelate extends SugarFieldBase {
//the key and copy indexes. 'key' is the suffix of the field we are searching
//the Account's address with. 'copy' is the suffix we are copying the addresses
//form fields into.
if(isset($vardef['module']) && preg_match('/Accounts/si',$vardef['module'])
&& isset($displayParams['key']) && isset($displayParams['copy'])) {
if (isset($vardef['module']) && preg_match('/Accounts/si', $vardef['module'])
&& isset($displayParams['key']) && isset($displayParams['copy'])
) {
if(isset($displayParams['key']) && is_array($displayParams['key'])) {
$database_key = $displayParams['key'];
if (isset($displayParams['key']) && is_array($displayParams['key'])) {
$database_key = $displayParams['key'];
} else {
$database_key[] = $displayParams['key'];
$database_key[] = $displayParams['key'];
}
if(isset($displayParams['copy']) && is_array($displayParams['copy'])) {
if (isset($displayParams['copy']) && is_array($displayParams['copy'])) {
$form = $displayParams['copy'];
} else {
$form[] = $displayParams['copy'];
}
if(count($database_key) != count($form)) {
global $app_list_strings;
$this->ss->trigger_error($app_list_strings['ERR_SMARTY_UNEQUAL_RELATED_FIELD_PARAMETERS']);
if (count($database_key) != count($form)) {
global $app_list_strings;
$this->ss->trigger_error($app_list_strings['ERR_SMARTY_UNEQUAL_RELATED_FIELD_PARAMETERS']);
} //if
$copy_phone = isset($displayParams['copyPhone']) ? $displayParams['copyPhone'] : true;
@ -104,10 +124,16 @@ class SugarFieldRelate extends SugarFieldBase {
$field_to_name = array();
$field_to_name['id'] = $vardef['id_name'];
$field_to_name['name'] = $vardef['name'];
$address_fields = isset($displayParams['field_to_name_array']) ? $displayParams['field_to_name_array'] : array('_address_street', '_address_city', '_address_state', '_address_postalcode', '_address_country');
$address_fields = isset($displayParams['field_to_name_array']) ? $displayParams['field_to_name_array'] : array(
'_address_street',
'_address_city',
'_address_state',
'_address_postalcode',
'_address_country'
);
$count = 0;
foreach($form as $f) {
foreach($address_fields as $afield) {
foreach ($form as $f) {
foreach ($address_fields as $afield) {
$field_to_name[$database_key[$count] . $afield] = $f . $afield;
}
$count++;
@ -119,10 +145,10 @@ class SugarFieldRelate extends SugarFieldBase {
'field_to_name_array' => $field_to_name,
);
if($copy_phone) {
$popup_request_data['field_to_name_array']['phone_office'] = 'phone_work';
if ($copy_phone) {
$popup_request_data['field_to_name_array']['phone_office'] = 'phone_work';
}
} elseif(isset($displayParams['field_to_name_array'])) {
} elseif (isset($displayParams['field_to_name_array'])) {
$popup_request_data = array(
'call_back_function' => $call_back_function,
'form_name' => $form_name,
@ -133,22 +159,22 @@ class SugarFieldRelate extends SugarFieldBase {
'call_back_function' => $call_back_function,
'form_name' => $form_name,
'field_to_name_array' => array(
//'id' => (empty($displayParams['idName']) ? $vardef['id_name'] : ($displayParams['idName'] . '_' . $vardef['id_name'])) ,
//bug 43770: Assigned to value could not be saved during lead conversion
'id' => (empty($displayParams['idNameHidden']) ? $vardef['id_name'] : ($displayParams['idNameHidden'] . $vardef['id_name'])) ,
((empty($vardef['rname'])) ? 'name' : $vardef['rname']) => (empty($displayParams['idName']) ? $vardef['name'] : $displayParams['idName']),
),
);
//'id' => (empty($displayParams['idName']) ? $vardef['id_name'] : ($displayParams['idName'] . '_' . $vardef['id_name'])) ,
//bug 43770: Assigned to value could not be saved during lead conversion
'id' => (empty($displayParams['idNameHidden']) ? $vardef['id_name'] : ($displayParams['idNameHidden'] . $vardef['id_name'])),
((empty($vardef['rname'])) ? 'name' : $vardef['rname']) => (empty($displayParams['idName']) ? $vardef['name'] : $displayParams['idName']),
),
);
}
$json = getJSONobj();
$displayParams['popupData'] = '{literal}'.$json->encode($popup_request_data). '{/literal}';
if(!isset($displayParams['readOnly'])) {
$displayParams['readOnly'] = '';
$displayParams['popupData'] = '{literal}' . $json->encode($popup_request_data) . '{/literal}';
if (!isset($displayParams['readOnly'])) {
$displayParams['readOnly'] = '';
} else {
$displayParams['readOnly'] = $displayParams['readOnly'] == false ? '' : 'READONLY';
$displayParams['readOnly'] = $displayParams['readOnly'] == false ? '' : 'READONLY';
}
$keys = $this->getAccessKey($vardef,'RELATE',$vardef['module']);
$keys = $this->getAccessKey($vardef, 'RELATE', $vardef['module']);
$displayParams['accessKeySelect'] = $keys['accessKeySelect'];
$displayParams['accessKeySelectLabel'] = $keys['accessKeySelectLabel'];
$displayParams['accessKeySelectTitle'] = $keys['accessKeySelectTitle'];
@ -157,49 +183,68 @@ class SugarFieldRelate extends SugarFieldBase {
$displayParams['accessKeyClearTitle'] = $keys['accessKeyClearTitle'];
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('EditView'));
}
function getPopupViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex){
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getPopupViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
$displayParams['formName'] = 'popup_query_form'; // Bug Fix #722
return $this->getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex);
}
function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
/**
* @param array $parentFieldArray
* @param array $vardef
* @param array $displayParams
* @param integer $tabindex
* @return string
*/
public function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
$call_back_function = 'set_return';
if(isset($displayParams['call_back_function'])) {
if (isset($displayParams['call_back_function'])) {
$call_back_function = $displayParams['call_back_function'];
}
$form_name = 'search_form';
if(isset($displayParams['formName'])) {
if (isset($displayParams['formName'])) {
$form_name = $displayParams['formName'];
}
if(!empty($vardef['rname']) && $vardef['rname'] == 'user_name'){
$displayParams['useIdSearch'] = true;
if (!empty($vardef['rname']) && $vardef['rname'] === 'user_name') {
$displayParams['useIdSearch'] = true;
}
//Special Case for accounts; use the displayParams array and retrieve
//the key and copy indexes. 'key' is the suffix of the field we are searching
//the Account's address with. 'copy' is the suffix we are copying the addresses
//form fields into.
if(isset($vardef['module']) && preg_match('/Accounts/si',$vardef['module'])
&& isset($displayParams['key']) && isset($displayParams['copy'])) {
if (isset($vardef['module']) && preg_match('/Accounts/si', $vardef['module'])
&& isset($displayParams['key']) && isset($displayParams['copy'])
) {
if(isset($displayParams['key']) && is_array($displayParams['key'])) {
$database_key = $displayParams['key'];
if (isset($displayParams['key']) && is_array($displayParams['key'])) {
$database_key = $displayParams['key'];
} else {
$database_key[] = $displayParams['key'];
$database_key[] = $displayParams['key'];
}
if(isset($displayParams['copy']) && is_array($displayParams['copy'])) {
if (isset($displayParams['copy']) && is_array($displayParams['copy'])) {
$form = $displayParams['copy'];
} else {
$form[] = $displayParams['copy'];
}
if(count($database_key) != count($form)) {
global $app_list_strings;
$this->ss->trigger_error($app_list_strings['ERR_SMARTY_UNEQUAL_RELATED_FIELD_PARAMETERS']);
if (count($database_key) != count($form)) {
global $app_list_strings;
$this->ss->trigger_error($app_list_strings['ERR_SMARTY_UNEQUAL_RELATED_FIELD_PARAMETERS']);
} //if
$copy_phone = isset($displayParams['copyPhone']) ? $displayParams['copyPhone'] : true;
@ -207,10 +252,16 @@ class SugarFieldRelate extends SugarFieldBase {
$field_to_name = array();
$field_to_name['id'] = $vardef['id_name'];
$field_to_name['name'] = $vardef['name'];
$address_fields = array('_address_street', '_address_city', '_address_state', '_address_postalcode', '_address_country');
$address_fields = array(
'_address_street',
'_address_city',
'_address_state',
'_address_postalcode',
'_address_country'
);
$count = 0;
foreach($form as $f) {
foreach($address_fields as $afield) {
foreach ($form as $f) {
foreach ($address_fields as $afield) {
$field_to_name[$database_key[$count] . $afield] = $f . $afield;
}
$count++;
@ -222,10 +273,10 @@ class SugarFieldRelate extends SugarFieldBase {
'field_to_name_array' => $field_to_name,
);
if($copy_phone) {
$popup_request_data['field_to_name_array']['phone_office'] = 'phone_work';
if ($copy_phone) {
$popup_request_data['field_to_name_array']['phone_office'] = 'phone_work';
}
} elseif(isset($displayParams['field_to_name_array'])) {
} elseif (isset($displayParams['field_to_name_array'])) {
$popup_request_data = array(
'call_back_function' => $call_back_function,
'form_name' => $form_name,
@ -236,148 +287,170 @@ class SugarFieldRelate extends SugarFieldBase {
'call_back_function' => $call_back_function,
'form_name' => $form_name,
'field_to_name_array' => array(
'id' => $vardef['id_name'],
((empty($vardef['rname'])) ? 'name' : $vardef['rname']) => $vardef['name'],
),
);
'id' => $vardef['id_name'],
((empty($vardef['rname'])) ? 'name' : $vardef['rname']) => $vardef['name'],
),
);
}
$json = getJSONobj();
$displayParams['popupData'] = '{literal}'.$json->encode($popup_request_data). '{/literal}';
if(!isset($displayParams['readOnly'])) {
$displayParams['readOnly'] = '';
$displayParams['popupData'] = '{literal}' . $json->encode($popup_request_data) . '{/literal}';
if (!isset($displayParams['readOnly'])) {
$displayParams['readOnly'] = '';
} else {
$displayParams['readOnly'] = $displayParams['readOnly'] == false ? '' : 'READONLY';
$displayParams['readOnly'] = $displayParams['readOnly'] == false ? '' : 'READONLY';
}
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('SearchView'));
}
function formatField($rawField, $vardef) {
if ('contact_name' == $vardef['name']){
$default_locale_name_format = $GLOBALS['current_user']->getPreference('default_locale_name_format');
$default_locale_name_format = trim(preg_replace('/s/i', '', $default_locale_name_format));
/**
* @param array $rawField
* @param array $vardef
* @return string
*/
public function formatField($rawField, $vardef)
{
if ('contact_name' == $vardef['name']) {
$default_locale_name_format = $GLOBALS['current_user']->getPreference('default_locale_name_format');
$default_locale_name_format = trim(preg_replace('/s/i', '', $default_locale_name_format));
$new_field = '';
$names = array();
$names = array();
$temp = explode(' ', $rawField);
if ( !isset($temp[1]) ) {
if (!isset($temp[1])) {
$names['f'] = '';
$names['l'] = $temp[0];
}
elseif ( !empty($temp) ) {
} elseif (!empty($temp)) {
$names['f'] = $temp[0];
$names['l'] = $temp[1];
}
for($i=0;$i<strlen($default_locale_name_format);$i++){
$new_field .= array_key_exists($default_locale_name_format{$i}, $names) ? $names[$default_locale_name_format{$i}] : $default_locale_name_format{$i};
for ($i = 0; $i < strlen($default_locale_name_format); $i++) {
$new_field .= array_key_exists($default_locale_name_format{$i},
$names) ? $names[$default_locale_name_format{$i}] : $default_locale_name_format{$i};
}
}
else $new_field = $rawField;
} else {
$new_field = $rawField;
}
return $new_field;
}
/**
* @see SugarFieldBase::importSanitize()
* @param string $value
* @param array $vardef
* @param SugarBean $focus
* @param ImportFieldSanitize $settings
* @return array|bool|string
*/
public function importSanitize(
$value,
$vardef,
$focus,
ImportFieldSanitize $settings
)
{
if ( !isset($vardef['module']) )
) {
if (!isset($vardef['module'])) {
return false;
}
$newbean = loadBean($vardef['module']);
// Bug 38885 - If we are relating to the Users table on user_name, there's a good chance
// that the related field data is the full_name, rather than the user_name. So to be sure
// let's try to lookup the field the relationship is expecting to use (user_name).
if ( $vardef['module'] == 'Users' && isset($vardef['rname']) && $vardef['rname'] == 'user_name' ) {
if ($vardef['module'] == 'Users' && isset($vardef['rname']) && $vardef['rname'] == 'user_name') {
$userFocus = new User;
$query = sprintf("SELECT user_name FROM {$userFocus->table_name} WHERE %s=%s AND deleted=0",
$userFocus->db->concat('users',array('first_name','last_name')), $userFocus->db->quoted($value));
$userFocus->db->concat('users', array('first_name', 'last_name')), $userFocus->db->quoted($value));
$username = $userFocus->db->getOne($query);
if(!empty($username)) {
if (!empty($username)) {
$value = $username;
}
}
// Bug 32869 - Assumed related field name is 'name' if it is not specified
if ( !isset($vardef['rname']) )
if (!isset($vardef['rname'])) {
$vardef['rname'] = 'name';
}
// Bug 27046 - Validate field against type as it is in the related field
$rvardef = $newbean->getFieldDefinition($vardef['rname']);
if ( isset($rvardef['type'])
&& method_exists($this,$rvardef['type']) ) {
if (isset($rvardef['type'])
&& method_exists($this, $rvardef['type'])
) {
$fieldtype = $rvardef['type'];
$returnValue = $settings->$fieldtype($value,$rvardef);
if ( !$returnValue )
$returnValue = $settings->$fieldtype($value, $rvardef);
if (!$returnValue) {
return false;
else
} else {
$value = $returnValue;
}
}
if ( isset($vardef['id_name']) ) {
if (isset($vardef['id_name'])) {
$idField = $vardef['id_name'];
// Bug 24075 - clear out id field value if it is invalid
if ( isset($focus->$idField) ) {
if (isset($focus->$idField)) {
$checkfocus = loadBean($vardef['module']);
if ( $checkfocus && is_null($checkfocus->retrieve($focus->$idField)) )
if ($checkfocus && is_null($checkfocus->retrieve($focus->$idField))) {
$focus->$idField = '';
}
}
// fixing bug #47722: Imports to Custom Relate Fields Do Not Work
if (!isset($vardef['table']))
{
if (!isset($vardef['table'])) {
// Set target module table as the default table name
$vardef['table'] = $newbean->table_name;
}
// be sure that the id isn't already set for this row
if ( empty($focus->$idField)
&& $idField != $vardef['name']
&& !empty($vardef['rname'])
&& !empty($vardef['table'])) {
if (empty($focus->$idField)
&& $idField != $vardef['name']
&& !empty($vardef['rname'])
&& !empty($vardef['table'])
) {
// Bug 27562 - Check db_concat_fields first to see if the field name is a concatenation.
$relatedFieldDef = $newbean->getFieldDefinition($vardef['rname']);
if ( isset($relatedFieldDef['db_concat_fields'])
&& is_array($relatedFieldDef['db_concat_fields']) )
$fieldName = $focus->db->concat($vardef['table'],$relatedFieldDef['db_concat_fields']);
else
if (isset($relatedFieldDef['db_concat_fields'])
&& is_array($relatedFieldDef['db_concat_fields'])
) {
$fieldName = $focus->db->concat($vardef['table'], $relatedFieldDef['db_concat_fields']);
} else {
$fieldName = $vardef['rname'];
}
// lookup first record that matches in linked table
$query = "SELECT id
FROM {$vardef['table']}
WHERE {$fieldName} = '" . $focus->db->quote($value) . "'
AND deleted != 1";
$result = $focus->db->limitQuery($query,0,1,true, "Want only a single row");
if(!empty($result)){
if ( $relaterow = $focus->db->fetchByAssoc($result) )
$result = $focus->db->limitQuery($query, 0, 1, true, "Want only a single row");
if (!empty($result)) {
if ($relaterow = $focus->db->fetchByAssoc($result)) {
$focus->$idField = $relaterow['id'];
elseif ( !$settings->addRelatedBean
|| ( $newbean->bean_implements('ACL') && !$newbean->ACLAccess('save') )
|| ( in_array($newbean->module_dir,array('Teams','Users')) )
)
} elseif (!$settings->addRelatedBean
|| ($newbean->bean_implements('ACL') && !$newbean->ACLAccess('save'))
|| (in_array($newbean->module_dir, array('Teams', 'Users')))
) {
return false;
else {
} else {
// add this as a new record in that bean, then relate
if ( isset($relatedFieldDef['db_concat_fields'])
&& is_array($relatedFieldDef['db_concat_fields']) ) {
if (isset($relatedFieldDef['db_concat_fields'])
&& is_array($relatedFieldDef['db_concat_fields'])
) {
assignConcatenatedValue($newbean, $relatedFieldDef, $value);
} else {
$newbean->$fieldName = $value;
}
if ( !isset($focus->assigned_user_id) || $focus->assigned_user_id == '' )
if (!isset($focus->assigned_user_id) || $focus->assigned_user_id == '') {
$newbean->assigned_user_id = $GLOBALS['current_user']->id;
else
} else {
$newbean->assigned_user_id = $focus->assigned_user_id;
if ( !isset($focus->modified_user_id) || $focus->modified_user_id == '' )
}
if (!isset($focus->modified_user_id) || $focus->modified_user_id == '') {
$newbean->modified_user_id = $GLOBALS['current_user']->id;
else
} else {
$newbean->modified_user_id = $focus->modified_user_id;
}
// populate fields from the parent bean to the child bean
$focus->populateRelatedBean($newbean);
@ -385,7 +458,7 @@ class SugarFieldRelate extends SugarFieldBase {
$newbean->save(false);
$focus->$idField = $newbean->id;
ImportFieldSanitize::$createdBeans[] = ImportFile::writeRowToLastImport(
$focus->module_dir,$newbean->object_name,$newbean->id);
$focus->module_dir, $newbean->object_name, $newbean->id);
}
}
}

View file

@ -73,12 +73,12 @@ function __construct() {
/**
* parse
*
* @param $filePath The file path of the HTML file to parse
* @param $vardefs The module's vardefs
* @param $moduleDir The module's directory
* @param $merge boolean value indicating whether or not to merge the parsed contents
* @param $masterCopy The file path of the mater copy of the metadata file to merge against
* @return String format of metadata contents
* @param string $filePath The file path of the HTML file to parse
* @param array $vardefs The module's vardefs
* @param string $moduleDir The module's directory
* @param boolean $merge value indicating whether or not to merge the parsed contents
* @param array|null $masterCopy The file path of the mater copy of the metadata file to merge against
* @return string format of metadata contents
**/
function parse($filePath, $vardefs = array(), $moduleDir = '', $merge=false, $masterCopy=null) {

View file

@ -91,10 +91,11 @@ class SugarFieldHandler
/**
* return the singleton of the SugarField
*
* @param field string field type
* @param $field
* @param bool $returnNullIfBase
* @return mixed
*/
static function getSugarField($field, $returnNullIfBase=false) {
public static function getSugarField($field, $returnNullIfBase=false) {
static $sugarFieldObjects = array();
$field = self::fixupFieldType($field);

View file

@ -226,6 +226,10 @@ class SugarFolder
$cleanSubscriptions = array();
// remove the duplications
$subs = array_unique($subs);
// ensure parent folders are selected, regardless.
foreach ($subs as $id) {
$id = trim($id);
@ -542,6 +546,7 @@ class SugarFolder
$myEmailTypeString = 'inbound';
$myDraftsTypeString = 'draft';
$mySentEmailTypeString = 'sent';
$myArchiveTypeString = 'archived';
if (empty($user)) {
global $current_user;
@ -564,7 +569,10 @@ class SugarFolder
$found = array();
while ($a = $this->db->fetchByAssoc($r)) {
if ($a['folder_type'] == $myEmailTypeString) {
if (!empty($a['folder_type']) &&
$a['folder_type'] !== $myArchiveTypeString &&
$a['created_by'] === $current_user->id
) {
if (!isset($found[$a['id']])) {
$found[$a['id']] = true;
@ -673,6 +681,7 @@ class SugarFolder
// And empty sugar folder exception is ok in this case.
}
$user = $this->removeDeletedFolders($user);
$ret = array(
'userFolders' => $user,
@ -682,6 +691,34 @@ class SugarFolder
return $ret;
}
/**
* Remove folders of deleted inbounds
*
* @param array $folders - array of folders table rows
* @return array
*/
private function removeDeletedFolders($folders) {
$ret = array();
foreach($folders as $folder) {
$correct = false;
if(!$folder['id']) {
$correct = true;
}
$ie = BeanFactory::getBean('InboundEmail', $folder['id']);
if($ie) {
$correct = true;
}
if($correct) {
$ret[] = $folder;
}
}
return $ret;
}
public function getFoldersChildForSettings($a, $collection, $subscriptions)
{
$a['selected'] = (in_array($a['id'], $subscriptions)) ? true : false;

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ASSIGNED_TO_ID'=>'Assigned User Id',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_SECURITYGROUPS' => "Security Groups",

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_TEAM'=>'Teams',

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,10 +34,14 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ID' => 'ID',
'LBL_DATE_ENTERED' => 'Date Created',

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,8 +34,8 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,8 +34,8 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,8 +34,8 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,8 +34,8 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {

View file

@ -42,7 +42,7 @@ if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
class <module_name > ViewEdit extends ViewEdit{
class <module_name>ViewEdit extends ViewEdit{
public function display()
{

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,10 +34,14 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$object_name = strtolower($object_name);
$app_list_strings = array(

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,8 +34,8 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,10 +34,14 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_SALUTATION' => 'Salutation',
'LBL_NAME' => 'Name',

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,8 +34,8 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,8 +34,8 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {

View file

@ -42,15 +42,14 @@ if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
include_once 'include/SuiteEditor/SuiteEditorInterface.php';
include_once 'include/SuiteEditor/SuiteEditorSettings.php';
include_once 'include/SuiteEditor/SuiteEditorSettingsForDirectHTML.php';
include_once 'include/SuiteEditor/SuiteEditorDirectHTML.php';
include_once 'include/SuiteEditor/SuiteEditorSettingsForTinyMCE.php';
include_once 'include/SuiteEditor/SuiteEditorTinyMCE.php';
include_once 'include/SuiteEditor/SuiteEditorSettingsForMozaik.php';
include_once 'include/SuiteEditor/SuiteEditorMozaik.php';
include_once 'include/SuiteEditor/SuiteEditorConnector.php';
include_once get_custom_file_if_exists('include/SuiteEditor/SuiteEditorInterface.php');
include_once get_custom_file_if_exists('include/SuiteEditor/SuiteEditorSettings.php');
include_once get_custom_file_if_exists('include/SuiteEditor/SuiteEditorSettingsForDirectHTML.php');
include_once get_custom_file_if_exists('include/SuiteEditor/SuiteEditorDirectHTML.php');
include_once get_custom_file_if_exists('include/SuiteEditor/SuiteEditorSettingsForTinyMCE.php');
include_once get_custom_file_if_exists('include/SuiteEditor/SuiteEditorTinyMCE.php');
include_once get_custom_file_if_exists('include/SuiteEditor/SuiteEditorSettingsForMozaik.php');
include_once get_custom_file_if_exists('include/SuiteEditor/SuiteEditorMozaik.php');
/**
* Class SuiteEditor
@ -75,7 +74,8 @@ class SuiteEditorConnector
editor.on('focus', function(e){
onClickTemplateBody();
});
}
},
plugins: ['code', 'table', 'link'],
}");
}
@ -131,7 +131,7 @@ class SuiteEditorConnector
$smarty = new Sugar_Smarty();
$smarty->assign('editor', $editor->getHtml());
return $smarty->fetch('include/SuiteEditor/tpls/SuiteEditorConnector.tpl');
return $smarty->fetch(get_custom_file_if_exists('include/SuiteEditor/tpls/SuiteEditorConnector.tpl'));
}
}

View file

@ -71,7 +71,7 @@ class SuiteEditorDirectHTML implements SuiteEditorInterface
public function getHtml() {
$smarty = new Sugar_Smarty();
$smarty->assign((array)$this->settings);
return $smarty->fetch('include/SuiteEditor/tpls/SuiteEditorDirectHTML.tpl');
return $smarty->fetch(get_custom_file_if_exists('include/SuiteEditor/tpls/SuiteEditorDirectHTML.tpl'));
}
}

View file

@ -86,7 +86,7 @@ class SuiteEditorMozaik implements SuiteEditorInterface
$this->settings->group,
$this->settings->tinyMCESetup
));
return $smarty->fetch('include/SuiteEditor/tpls/SuiteEditorMozaik.tpl');
return $smarty->fetch(get_custom_file_if_exists('include/SuiteEditor/tpls/SuiteEditorMozaik.tpl'));
}
}

View file

@ -76,13 +76,6 @@ abstract class SuiteEditorSettings
*/
public $group;
/**
* JSON setting for TinyMCE initializer script
*
* @var string
*/
public $tinyMCESetup = '{}';
/**
* Javascript for body click handling
*

View file

@ -49,7 +49,7 @@ if (!defined('sugarEntry') || !sugarEntry) {
* in constructor, set the default settings for a mozaik editor
* and if settings argument exists extends it
*/
class SuiteEditorSettingsForMozaik extends SuiteEditorSettingsForDirectHTML
class SuiteEditorSettingsForMozaik extends SuiteEditorSettingsForTinyMCE
{
/**
@ -62,9 +62,4 @@ class SuiteEditorSettingsForMozaik extends SuiteEditorSettingsForDirectHTML
*/
public $group = '';
/**
* @var string
*/
public $tinyMCESetup = '{}';
}

View file

@ -55,4 +55,11 @@ if (!defined('sugarEntry') || !sugarEntry) {
class SuiteEditorSettingsForTinyMCE extends SuiteEditorSettingsForDirectHTML
{
/**
* JSON setting for TinyMCE initializer script
*
* @var string
*/
public $tinyMCESetup = '{}';
}

View file

@ -71,7 +71,7 @@ class SuiteEditorTinyMCE implements SuiteEditorInterface
public function getHtml() {
$smarty = new Sugar_Smarty();
$smarty->assign((array)$this->settings);
return $smarty->fetch('include/SuiteEditor/tpls/SuiteEditorTinyMCE.tpl');
return $smarty->fetch(get_custom_file_if_exists('include/SuiteEditor/tpls/SuiteEditorTinyMCE.tpl'));
}
}

View file

@ -434,9 +434,9 @@ class TemplateHandler
if ($field['type'] === 'relate' &&
isset($field['module']) &&
!empty($field['module']) &&
!empty($field['quicksearch']) ||
preg_match('/_name$|_c$/si', $name)
) {
if (preg_match('/^(Campaigns|Teams|Users|Contacts|Accounts)$/si', $field['module'], $matches)) {

View file

@ -77,7 +77,7 @@ class SugarCleaner
* Singleton instance
* @var SugarCleaner
*/
static public $instance;
private static $instance;
/**
* HTMLPurifier instance
@ -102,7 +102,7 @@ class SugarCleaner
$config->set('CSS.Proprietary', true);
$config->set('HTML.TidyLevel', 'light');
$config->set('HTML.ForbiddenElements', array('body' => true, 'html' => true));
$config->set('AutoFormat.RemoveEmpty', false);
$config->set('AutoFormat.RemoveEmpty', true);
$config->set('Cache.SerializerPermissions', 0775);
// for style
//$config->set('Filter.ExtractStyleBlocks', true);
@ -167,40 +167,31 @@ class SugarCleaner
*/
public static function getInstance()
{
if(is_null(self::$instance)) {
self::$instance = new self;
}
return self::$instance;
return self::$instance instanceof self ? self::$instance : (self::$instance = new self());
}
/**
* Clean string from potential XSS problems
* @param string $html
* @param bool $encoded Was it entity-encoded?
* @param string $dirty_html
* @param bool $encode_html - encodes html
* @return string
*/
static public function cleanHtml($html, $encoded = false)
public static function cleanHtml($dirty_html, $encode_html = false)
{
if(empty($html)) return $html;
$sugarCleaner = new SugarCleaner();
$purifier = $sugarCleaner->purifier;
if($encoded) {
$html = from_html($html);
// $encode_html previously effected the decoding process.
// we should decode regardless, just in case, the calling method passing encoded html
$dirty_html_decoded = utf8_decode(html_entity_decode($dirty_html));
$clean_html = $purifier->purify($dirty_html_decoded);
// Re-encode html
if ($encode_html === true) {
$clean_html = htmlentities($clean_html);
}
if(!preg_match('<[^-A-Za-z0-9 `~!@#$%^&*()_=+{}\[\];:\'",./\\?\r\n|\x80-\xFF]>', $html)) {
/* if it only has "safe" chars, don't bother */
$cleanhtml = $html;
} else {
$purifier = self::getInstance()->purifier;
$cleanhtml = $purifier->purify($html);
// $styles = $purifier->context->get('StyleBlocks');
// if(count($styles) > 0) {
// $cleanhtml = "<style>".join("</style><style>", $styles)."</style>".$cleanhtml;
// }
}
if($encoded) {
$cleanhtml = to_html($cleanhtml);
}
return $cleanhtml;
return $clean_html;
}
static public function stripTags($string, $encoded = true)

View file

@ -114,7 +114,7 @@ function populateFromPost($prefix, &$focus, $skipRetrieve = false, $checkACL = f
$type = !empty($def['custom_type']) ? $def['custom_type'] : $def['type'];
$sf = $sfh->getSugarField($type);
$sf = $sfh::getSugarField($type);
if($sf != null){
$sf->save($focus, $_POST, $field, $def, $prefix);
} else {

View file

@ -1,41 +1,4 @@
/**
*
* 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 - 2017 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".
*//**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@ -73,154 +36,8 @@
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
(function ($) {
$.fn.EmailsComposeViewModal = function (options) {
"use strict";
var self = {};
var opts = $.extend({}, $.fn.EmailsComposeViewModal.defaults, options);
self.handleClick = function (e) {
"use strict";
var self = this;
self.emailComposeView = null;
var opts = $.extend({}, $.fn.EmailsComposeViewModal.defaults);
var composeBox = $('<div></div>').appendTo(opts.contentSelector);
composeBox.messageBox({"showHeader": false, "showFooter": false, "size": 'lg',});
composeBox.setBody('<div class="email-in-progress"><img src="themes/' + SUGAR.themes.theme_name + '/images/loading.gif"></div>');
composeBox.show();
$.ajax({type: "GET", cache: false, url: 'index.php?module=Emails&action=ComposeView'}).done(function (data) {
if (data.length === 0) {
console.error("Unable to display ComposeView");
composeBox.setBody(SUGAR.language.translate('', 'ERR_AJAX_LOAD'));
return;
}
composeBox.setBody(data);
self.emailComposeView = composeBox.controls.modal.body.find('.compose-view').EmailsComposeView();
$(self.emailComposeView).on('sentEmail', function (event, composeView) {
composeBox.hide();
composeBox.remove();
});
$(self.emailComposeView).on('disregardDraft', function (event, composeView) {
if (typeof messageBox !== "undefined") {
var mb = messageBox({size: 'lg'});
mb.setBody(SUGAR.language.translate('Emails', 'LBL_CONFIRM_DELETE_EMAIL'));
mb.on('ok', function () {
mb.remove();
composeBox.hide();
composeBox.remove();
});
mb.on('cancel', function () {
mb.remove();
});
mb.show();
} else {
if (confirm(self.translatedErrorMessage)) {
composeBox.hide();
composeBox.remove();
}
}
});
composeBox.on('cancel', function () {
composeBox.remove();
});
composeBox.on('hide.bs.modal', function () {
composeBox.remove();
});
}).fail(function (data) {
composeBox.controls.modal.content.html(SUGAR.language.translate('', 'LBL_EMAIL_ERROR_GENERAL_TITLE'));
});
return $(this);
};
self.construct = function () {
"use strict";
$(opts.buttonSelector).click(self.handleClick)
};
self.destruct = function () {
};
self.construct();
return $(self);
};
$.fn.openComposeViewModal = function (source) {
"use strict";
var self = this;
self.emailComposeView = null;
var opts = $.extend({}, $.fn.EmailsComposeViewModal.defaults);
var composeBox = $('<div></div>').appendTo(opts.contentSelector);
composeBox.messageBox({"showHeader": false, "showFooter": false, "size": 'lg',});
composeBox.setBody('<div class="email-in-progress"><img src="themes/' + SUGAR.themes.theme_name + '/images/loading.gif"></div>');
composeBox.show();
$.ajax({type: "GET", cache: false, url: 'index.php?module=Emails&action=ComposeView'}).done(function (data) {
if (data.length === 0) {
console.error("Unable to display ComposeView");
composeBox.setBody(SUGAR.language.translate('', 'ERR_AJAX_LOAD'));
return;
}
composeBox.setBody(data);
self.emailComposeView = composeBox.controls.modal.body.find('.compose-view').EmailsComposeView();
// Populate fields
if($(source).attr('data-record-id') !== '') {
var populateModule = $(source).attr('data-module');
var populateModuleRecord = $(source).attr('data-record-id');
var populateModuleName = $(source).attr('data-module-name');
var populateEmailAddress = $(source).attr('data-email-address');
if(populateModuleName !== '') {
populateEmailAddress = populateModuleName + ' <' + populateEmailAddress + '>';
}
$(self.emailComposeView).find('#to_addrs_names').val(populateEmailAddress);
$(self.emailComposeView).find('#parent_type').val(populateModule);
$(self.emailComposeView).find('#parent_name').val(populateModuleName);
$(self.emailComposeView).find('#parent_id').val(populateModuleRecord);
}
$(self.emailComposeView).on('sentEmail', function (event, composeView) {
composeBox.hide();
composeBox.remove();
});
$(self.emailComposeView).on('disregardDraft', function (event, composeView) {
if (typeof messageBox !== "undefined") {
var mb = messageBox({size: 'lg'});
mb.setBody(SUGAR.language.translate('Emails', 'LBL_CONFIRM_DELETE_EMAIL'));
mb.on('ok', function () {
mb.remove();
composeBox.hide();
composeBox.remove();
});
mb.on('cancel', function () {
mb.remove();
});
mb.show();
} else {
if (confirm(self.translatedErrorMessage)) {
composeBox.hide();
composeBox.remove();
}
}
});
composeBox.on('cancel', function () {
composeBox.remove();
});
composeBox.on('hide.bs.modal', function () {
composeBox.remove();
});
}).fail(function (data) {
composeBox.controls.modal.content.html(SUGAR.language.translate('', 'LBL_EMAIL_ERROR_GENERAL_TITLE'));
});
return $(this);
};
$.fn.EmailsComposeViewModal.defaults = {
'selected': 'INBOX',
'buttonSelector': '[data-action=emails-show-compose-modal]',
'contentSelector': '#content'
}
}(jQuery));
(function($){$.fn.EmailsComposeViewModal=function(options){"use strict";var self=this;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults,options);self.handleClick=function(e){"use strict";var self=this;self.emailComposeView=null;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults);var composeBox=$('<div></div>').appendTo(opts.contentSelector);composeBox.messageBox({"showHeader":false,"showFooter":false,"size":'lg',});composeBox.setBody('<div class="email-in-progress"><img src="themes/'+SUGAR.themes.theme_name+'/images/loading.gif"></div>');composeBox.show();$.ajax({type:"GET",cache:false,url:'index.php?module=Emails&action=ComposeView&in_popup=1'}).done(function(data){if(data.length===0){console.error("Unable to display ComposeView");composeBox.setBody(SUGAR.language.translate('','ERR_AJAX_LOAD'));return;}
composeBox.setBody(data);self.emailComposeView=composeBox.controls.modal.body.find('.compose-view').EmailsComposeView();$(self.emailComposeView).on('sentEmail',function(event,composeView){composeBox.hide();composeBox.remove();});$(self.emailComposeView).on('disregardDraft',function(event,composeView){if(typeof messageBox!=="undefined"){var mb=messageBox({size:'lg'});mb.setBody(SUGAR.language.translate('Emails','LBL_CONFIRM_DELETE_EMAIL'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();}else{if(confirm(self.translatedErrorMessage)){composeBox.hide();composeBox.remove();}}});composeBox.on('cancel',function(){composeBox.remove();});composeBox.on('hide.bs.modal',function(){composeBox.remove();});}).fail(function(data){composeBox.controls.modal.content.html(SUGAR.language.translate('','LBL_EMAIL_ERROR_GENERAL_TITLE'));});return $(self);};self.construct=function(){"use strict";$(opts.buttonSelector).click(self.handleClick)};self.destruct=function(){};self.construct();return $(self);};$.fn.openComposeViewModal=function(source){"use strict";var self=this;self.emailComposeView=null;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults);var composeBox=$('<div></div>').appendTo(opts.contentSelector);composeBox.messageBox({"showHeader":false,"showFooter":false,"size":'lg',});composeBox.setBody('<div class="email-in-progress"><img src="themes/'+SUGAR.themes.theme_name+'/images/loading.gif"></div>');composeBox.show();$.ajax({type:"GET",cache:false,url:'index.php?module=Emails&action=ComposeView&in_popup=1'}).done(function(data){if(data.length===0){console.error("Unable to display ComposeView");composeBox.setBody(SUGAR.language.translate('','ERR_AJAX_LOAD'));return;}
composeBox.setBody(data);self.emailComposeView=composeBox.controls.modal.body.find('.compose-view').EmailsComposeView();if($(source).attr('data-record-id')!==''){var populateModule=$(source).attr('data-module');var populateModuleRecord=$(source).attr('data-record-id');var populateModuleName=$(source).attr('data-module-name');var populateEmailAddress=$(source).attr('data-email-address');if(populateModuleName!==''){populateEmailAddress=populateModuleName+' <'+populateEmailAddress+'>';}
$(self.emailComposeView).find('#to_addrs_names').val(populateEmailAddress);$(self.emailComposeView).find('#parent_type').val(populateModule);$(self.emailComposeView).find('#parent_name').val(populateModuleName);$(self.emailComposeView).find('#parent_id').val(populateModuleRecord);}
$(self.emailComposeView).on('sentEmail',function(event,composeView){composeBox.hide();composeBox.remove();});$(self.emailComposeView).on('disregardDraft',function(event,composeView){if(typeof messageBox!=="undefined"){var mb=messageBox({size:'lg'});mb.setBody(SUGAR.language.translate('Emails','LBL_CONFIRM_DELETE_EMAIL'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();}else{if(confirm(self.translatedErrorMessage)){composeBox.hide();composeBox.remove();}}});composeBox.on('cancel',function(){composeBox.remove();});composeBox.on('hide.bs.modal',function(){composeBox.remove();});}).fail(function(data){composeBox.controls.modal.content.html(SUGAR.language.translate('','LBL_EMAIL_ERROR_GENERAL_TITLE'));});return $(self);};$.fn.EmailsComposeViewModal.defaults={'selected':'INBOX','buttonSelector':'[data-action=emails-show-compose-modal]','contentSelector':'#content'};}(jQuery));

View file

@ -1,6 +1,9 @@
/*********************************************************************************
* 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 - 2014 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
@ -28,9 +31,9 @@
*
* 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. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* 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 closePopup(){var closePopup=window.opener.get_close_popup();if(closePopup)
{window.close();}}

View file

@ -1,9 +1,10 @@
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -14,7 +15,7 @@
*
* 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
* 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
@ -32,61 +33,38 @@
* 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".
********************************************************************************/
var popup_request_data;var close_popup;function get_popup_request_data()
{return YAHOO.lang.JSON.stringify(window.document.popup_request_data);}
function get_close_popup()
{return window.document.close_popup;}
function open_popup(module_name,width,height,initial_filter,close_popup,hide_clear_button,popup_request_data,popup_mode,create,metadata)
{if(typeof(popupCount)=="undefined"||popupCount==0)
popupCount=1;window.document.popup_request_data=popup_request_data;window.document.close_popup=close_popup;width=(width==600)?800:width;height=(height==400)?800:height;URL='index.php?'
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
var popup_request_data;var close_popup;function get_popup_request_data(){return YAHOO.lang.JSON.stringify(window.document.popup_request_data);}
function get_close_popup(){return window.document.close_popup;}
function open_popup(module_name,width,height,initial_filter,close_popup,hide_clear_button,popup_request_data,popup_mode,create,metadata){if(typeof popupCount==="undefined"){var popupCount=1;}else if(popupCount==0){var popupCount=1;}
window.document.popup_request_data=popup_request_data;window.document.close_popup=close_popup;width=(width==600)?800:width;height=(height==400)?800:height;URL='index.php?'
+'module='+module_name
+'&action=Popup';if(initial_filter!='')
{URL+='&query=true'+initial_filter;}
if(hide_clear_button)
{URL+='&hide_clear_button=true';}
+'&action=Popup';if(initial_filter!=''){URL+='&query=true'+initial_filter;}
if(hide_clear_button){URL+='&hide_clear_button=true';}
windowName=module_name+'_popup_window'+popupCount;popupCount++;windowFeatures='width='+width
+',height='+height
+',resizable=1,scrollbars=1';if(popup_mode==''&&popup_mode=='undefined'){popup_mode='single';}
URL+='&mode='+popup_mode;if(create==''&&create=='undefined'){create='false';}
URL+='&create='+create;if(metadata!=''&&metadata!='undefined'){URL+='&metadata='+metadata;}
if(popup_request_data.jsonObject){var request_data=popup_request_data.jsonObject;}else{var request_data=popup_request_data;}
var request_data=[];if(popup_request_data.jsonObject){request_data=popup_request_data.jsonObject;}else{request_data=popup_request_data;}
var field_to_name_array_url='';if(request_data&&request_data.field_to_name_array!='undefined'){for(var key in request_data.field_to_name_array){if(key.toLowerCase()!='id'){field_to_name_array_url+='&field_to_name[]='+encodeURIComponent(key.toLowerCase());}}}
if(field_to_name_array_url){URL+=field_to_name_array_url;}
win=window.open(URL,windowName,windowFeatures);if(window.focus)
{win.focus();}
win=window.open(URL,windowName,windowFeatures);if(window.focus){win.focus();}
win.popupCount=popupCount;return win;}
var from_popup_return=false;function set_return(popup_reply_data)
{from_popup_return=true;var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;for(var the_key in name_to_value_array)
{if(the_key=='toJSON')
{}
else
{var displayValue=name_to_value_array[the_key].replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\'').replace(/&quot;/gi,'"');;if(window.document.forms[form_name]&&window.document.forms[form_name].elements[the_key])
{window.document.forms[form_name].elements[the_key].value=displayValue;SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);}}}}
function set_return_and_save(popup_reply_data)
{var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;for(var the_key in name_to_value_array)
{if(the_key=='toJSON')
{}
else
{window.document.forms[form_name].elements[the_key].value=name_to_value_array[the_key];SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);}}
var from_popup_return=false;function set_return(popup_reply_data){from_popup_return=true;var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;for(var the_key in name_to_value_array){if(the_key=='toJSON'){}
else{var displayValue=name_to_value_array[the_key].replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\'').replace(/&quot;/gi,'"');;if(window.document.forms[form_name]&&window.document.forms[form_name].elements[the_key]){window.document.forms[form_name].elements[the_key].value=displayValue;SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);}}}}
function set_return_and_save(popup_reply_data){var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;for(var the_key in name_to_value_array){if(the_key=='toJSON'){}
else{window.document.forms[form_name].elements[the_key].value=name_to_value_array[the_key];SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);}}
window.document.forms[form_name].return_module.value=window.document.forms[form_name].module.value;window.document.forms[form_name].return_action.value='DetailView';window.document.forms[form_name].return_id.value=window.document.forms[form_name].record.value;window.document.forms[form_name].action.value='Save';window.document.forms[form_name].submit();}
function set_return_and_save_targetlist(popup_reply_data)
{var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;var form_index=document.forms.length-1;sugarListView.get_checks();var uids=document.MassUpdate.uid.value;if(uids==''){return false;}
for(var the_key in name_to_value_array)
{if(the_key=='toJSON')
{}
else
{for(i=form_index;i>=0;i--)
{if(form_name==window.document.forms[form_index])
{form_index=i;break;}}
function set_return_and_save_targetlist(popup_reply_data){var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;var form_index=document.forms.length-1;sugarListView.get_checks();var uids=document.MassUpdate.uid.value;if(uids==''){return false;}
for(var the_key in name_to_value_array){if(the_key=='toJSON'){}
else{for(i=form_index;i>=0;i--){if(form_name==window.document.forms[form_index]){form_index=i;break;}}
window.document.forms[form_index].elements[get_element_index(form_index,the_key)].value=name_to_value_array[the_key];SUGAR.util.callOnChangeListers(window.document.forms[form_index].elements[get_element_index(form_index,the_key)]);}}
if(popup_reply_data.passthru_data.do_contacts)
{var form=window.document.forms[form_index];var do_contacts=$('<input type="hidden" name="do_contacts" value="1"/>');$(form).append(do_contacts);}
if(popup_reply_data.passthru_data.do_contacts){var form=window.document.forms[form_index];var do_contacts=$('<input type="hidden" name="do_contacts" value="1"/>');$(form).append(do_contacts);}
window.document.forms[form_index].elements[get_element_index(form_index,"return_module")].value=window.document.forms[form_index].elements[get_element_index(form_index,"module")].value;window.document.forms[form_index].elements[get_element_index(form_index,"return_action")].value='ListView';window.document.forms[form_index].elements[get_element_index(form_index,"uids")].value=uids;window.document.forms[form_index].submit();}
function get_element_index(form_index,element_name){var j=0;while(j<window.document.forms[form_index].elements.length){if(window.document.forms[form_index].elements[j].name==element_name){index=j;break;}
j++;}
return index;}
function get_initial_filter_by_account(form_name)
{var account_id=window.document.forms[form_name].account_id.value;var account_name=escape(window.document.forms[form_name].account_name.value);var initial_filter="&account_id="+account_id+"&account_name="+account_name;return initial_filter;}
function get_initial_filter_by_account(form_name){var account_id=window.document.forms[form_name].account_id.value;var account_name=escape(window.document.forms[form_name].account_name.value);var initial_filter="&account_id="+account_id+"&account_name="+account_name;return initial_filter;}

View file

@ -1,14 +1,11 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -19,7 +16,7 @@ if (!defined('sugarEntry') || !sugarEntry) {
*
* 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
* 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
@ -37,16 +34,13 @@ if (!defined('sugarEntry') || !sugarEntry) {
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
//the left value is the key stored in the db and the right value is ie display value
//to translate, only modify the right value in each key/value pair
@ -1075,7 +1069,7 @@ $app_strings = array(
'LBL_SORT' => 'Sort',
'LBL_OUTBOUND_EMAIL_ADD_SERVER' => 'Add Server...',
'LBL_EMAIL_SMTP_SSL_OR_TLS' => 'Enable SMTP over SSL or TLS?',
'LBL_NO_ACTION' => 'There is no action by that name.',
'LBL_NO_ACTION' => 'There is no action by that name: %s',
'LBL_NO_SHORTCUT_MENU' => 'There are no actions available.',
'LBL_NO_DATA' => 'No Data',
@ -1262,7 +1256,7 @@ $app_strings = array(
'LBL_EMAIL_IE_DELETE_SUCCESSFUL' => 'Deletion successful.',
'LBL_EMAIL_IE_SAVE' => 'Saving Mail Account Information',
'LBL_EMAIL_IMPORTING_EMAIL' => 'Importing Email',
'LBL_EMAIL_IMPORT_EMAIL' => 'Import to SuiteCRM',
'LBL_EMAIL_IMPORT_EMAIL' => 'Import into SuiteCRM',
'LBL_EMAIL_IMPORT_SETTINGS' => 'Import Settings',
'LBL_EMAIL_INVALID' => 'Invalid',
'LBL_EMAIL_LOADING' => 'Loading...',
@ -1427,6 +1421,7 @@ $app_strings = array(
'LBL_EMAIL_INVALID_SYSTEM_OUTBOUND' => 'An outgoing mail server is not configured to send emails. Please configure an outgoing mail server or select an outgoing mail server for the mail account that you are using in Settings >> Mail Account.',
'LBL_EMAIL_SHOW_READ' => 'Show All',
'LBL_EMAIL_SHOW_UNREAD_ONLY' => 'Show Unread Only',
'LBL_DEFAULT_EMAIL_SIGNATURES' => 'Default Signature',
'LBL_EMAIL_SIGNATURES' => 'Signatures',
'LBL_EMAIL_SIGNATURE_CREATE' => 'Create Signature',
'LBL_EMAIL_SIGNATURE_NAME' => 'Signature Name',

View file

@ -1,45 +1,42 @@
<!--
/*********************************************************************************
* 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 - 2017 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
/**
*
* 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 - 2017 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".
*/
-->
<!-- BEGIN: Quote_Subject -->
<p>SuiteCRM Quote - {QUOTE_SUBJECT}</p>

View file

@ -1639,6 +1639,7 @@ function get_select_options_with_id_separate_key($label_list, $key_list, $select
$select_options = '';
//for setting null selection values to human readable --None--
get_select_empty_option();
$pattern = "/'0?'></";
$replacement = "''>".$app_strings['LBL_NONE'].'<';
if ($massupdate) {
@ -1673,6 +1674,76 @@ function get_select_options_with_id_separate_key($label_list, $key_list, $select
return $select_options;
}
/**
* @param string $value
* @param bool $isSelected
* @param string $app_strings_label
* @return string as HTML eg <OPTION value="">--None--</OPTION>
*/
function get_select_empty_option($value = '', $isSelected = false, $app_strings_label = 'LBL_NONE')
{
global $app_strings;
$response = '<OPTION value="'.$value.'"';
if($isSelected === true) {
$response .= ' ' . 'selected';
}
$response .= '>' . $app_strings[$app_strings_label] . '</OPTION>';
return $response;
}
function get_select_full_option($value = '', $isSelected = false, $translatedLabel = '----')
{
global $app_strings;
$response = '<OPTION value="'.$value.'"';
if($isSelected === true) {
$response .= ' ' . 'selected';
}
$response .= '>';
$response .= $translatedLabel;
$response .= '</OPTION>';
return $response;
}
/**
* @param array $option_list
* @param string $selected_key
* @return string as HTML <OPTION value="id1">apple</OPTION><OPTION value="id2">banana</OPTION>
*/
function get_select_full_options_with_id($option_list = array(), $selected_key = '')
{
$response = '';
foreach ($option_list as $option_key => $option_value)
{
$isSelected = false;
if(empty($option_key)) {
continue;
}
if(empty($option_value)) {
continue;
}
if($option_key === $selected_key)
{
$isSelected = true;
}
$response .= get_select_full_option($option_key, $isSelected, $option_value);
}
return $response;
}
/**
* Call this method instead of die().
* We print the error message and then die with an appropriate
@ -5405,3 +5476,15 @@ function suite_strrpos($haystack, $needle, $offset = 0, $encoding = DEFAULT_UTIL
return strrpos($haystack, $needle, $offset);
}
}
/**
* @param string $id
* @return bool
* @todo add to a separated common validator class
*/
function isValidId($id) {
$valid = is_string($id) && preg_match('/^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$/i', $id);
return $valid;
}

View file

@ -1,9 +1,12 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
/**
*
* 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 - 2017 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
@ -13,7 +16,7 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
*
* 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
* 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
@ -30,17 +33,14 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
*
* 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. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
* 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".
*/
/*********************************************************************************
* Description:
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights
* Reserved. Contributor(s): ______________________________________..
* *******************************************************************************/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_BASIC_SEARCH' => 'Quick Filter',

View file

@ -1,41 +1,41 @@
<?php
/**
*
* 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 - 2017 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".
/**
*
* 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 - 2017 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
@ -105,10 +105,11 @@ $out = <<<EOQ
</header>
<div id="content">
<h2>{$mod_strings['LBL_OLD_PHP']}</h2>
<div class="floatbox full">{$msg}</div>
<div class="floatbox full">{$msg}
<div id="licenseaccept">
<input type="checkbox" class="checkbox" name="setup_old_php" id="button_next2" onClick='toggleNextButton();' {$checked} />
<a href='javascript:void(0)' onClick='toggleOldPHP();toggleNextButton();'>{$mod_strings['LBL_OLD_PHP_OK']}</a>
</div>
</div>
</div>
<hr>

View file

@ -39,7 +39,7 @@
(function ($) {
$.fn.EmailsComposeViewModal = function (options) {
"use strict";
var self = {};
var self = this;
var opts = $.extend({}, $.fn.EmailsComposeViewModal.defaults, options);
self.handleClick = function (e) {
@ -51,7 +51,7 @@
composeBox.messageBox({"showHeader": false, "showFooter": false, "size": 'lg',});
composeBox.setBody('<div class="email-in-progress"><img src="themes/' + SUGAR.themes.theme_name + '/images/loading.gif"></div>');
composeBox.show();
$.ajax({type: "GET", cache: false, url: 'index.php?module=Emails&action=ComposeView'}).done(function (data) {
$.ajax({type: "GET", cache: false, url: 'index.php?module=Emails&action=ComposeView&in_popup=1'}).done(function (data) {
if (data.length === 0) {
console.error("Unable to display ComposeView");
composeBox.setBody(SUGAR.language.translate('', 'ERR_AJAX_LOAD'));
@ -94,7 +94,7 @@
}).fail(function (data) {
composeBox.controls.modal.content.html(SUGAR.language.translate('', 'LBL_EMAIL_ERROR_GENERAL_TITLE'));
});
return $(this);
return $(self);
};
self.construct = function () {
@ -117,7 +117,7 @@
composeBox.messageBox({"showHeader": false, "showFooter": false, "size": 'lg',});
composeBox.setBody('<div class="email-in-progress"><img src="themes/' + SUGAR.themes.theme_name + '/images/loading.gif"></div>');
composeBox.show();
$.ajax({type: "GET", cache: false, url: 'index.php?module=Emails&action=ComposeView'}).done(function (data) {
$.ajax({type: "GET", cache: false, url: 'index.php?module=Emails&action=ComposeView&in_popup=1'}).done(function (data) {
if (data.length === 0) {
console.error("Unable to display ComposeView");
composeBox.setBody(SUGAR.language.translate('', 'ERR_AJAX_LOAD'));
@ -178,12 +178,12 @@
}).fail(function (data) {
composeBox.controls.modal.content.html(SUGAR.language.translate('', 'LBL_EMAIL_ERROR_GENERAL_TITLE'));
});
return $(this);
return $(self);
};
$.fn.EmailsComposeViewModal.defaults = {
'selected': 'INBOX',
'buttonSelector': '[data-action=emails-show-compose-modal]',
'contentSelector': '#content'
}
};
}(jQuery));

View file

@ -176,7 +176,7 @@
self.headerContent = '<button type="button" class="close btn-cancel" aria-label="Close"><span aria-hidden="true">×</span></button><h4 class="modal-title"></h4>';
self.footerContent = '<button class="button btn-ok" type="button">'+SUGAR.language.translate('','LBL_OK')+'</button> <button class="button btn-cancel" type="button">'+SUGAR.language.translate('','LBL_CANCEL_BUTTON_LABEL')+'</button> ';
self.construct = function (constructOptions) {
"use strict";
if(typeof self.controls.modal.container === "undefined") {
@ -236,6 +236,9 @@
self.controls.modal.footer.html(opts.footerContent);
// OK / Cancel
self.controls.modal.buttons = {};
self.controls.modal.buttons.ok = $(self.controls.modal.container).find('.btn-ok');
self.controls.modal.buttons.cancel = $(self.controls.modal.container).find('.btn-cancel');
self.controls.modal.container.find('.btn-ok').click(opts.onOK);
self.controls.modal.container.find('.btn-cancel').click(opts.onCancel);
@ -244,7 +247,7 @@
};
if(opts.showFooter === false) {
self.controls.modal.footer.hide()
self.controls.modal.footer.hide();
};
self.modal(opts);

View file

@ -1,9 +1,10 @@
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -14,7 +15,7 @@
*
* 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
* 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
@ -32,102 +33,98 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
var popup_request_data;
var close_popup;
function get_popup_request_data()
{
return YAHOO.lang.JSON.stringify(window.document.popup_request_data);
function get_popup_request_data() {
return YAHOO.lang.JSON.stringify(window.document.popup_request_data);
}
function get_close_popup()
{
return window.document.close_popup;
function get_close_popup() {
return window.document.close_popup;
}
function open_popup(module_name, width, height, initial_filter, close_popup, hide_clear_button, popup_request_data, popup_mode, create, metadata)
{
if (typeof(popupCount) == "undefined" || popupCount == 0)
popupCount = 1;
// set the variables that the popup will pull from
window.document.popup_request_data = popup_request_data;
window.document.close_popup = close_popup;
//globally changing width and height of standard pop up window from 600 x 400 to 800 x 800
width = (width == 600) ? 800 : width;
height = (height == 400) ? 800 : height;
// launch the popup
URL = 'index.php?'
+ 'module=' + module_name
+ '&action=Popup';
if(initial_filter != '')
{
URL += '&query=true' + initial_filter;
}
if(hide_clear_button)
{
URL += '&hide_clear_button=true';
}
windowName = module_name + '_popup_window' + popupCount;
popupCount++;
windowFeatures = 'width=' + width
+ ',height=' + height
+ ',resizable=1,scrollbars=1';
function open_popup(module_name, width, height, initial_filter, close_popup, hide_clear_button, popup_request_data, popup_mode, create, metadata) {
if (typeof popupCount === "undefined") {
var popupCount = 1;
} else if(popupCount == 0) {
var popupCount = 1;
}
// set the variables that the popup will pull from
window.document.popup_request_data = popup_request_data;
window.document.close_popup = close_popup;
//globally changing width and height of standard pop up window from 600 x 400 to 800 x 800
width = (width == 600) ? 800 : width;
height = (height == 400) ? 800 : height;
if (popup_mode == '' && popup_mode == 'undefined') {
popup_mode='single';
}
URL+='&mode='+popup_mode;
if (create == '' && create == 'undefined') {
create = 'false';
}
URL+='&create='+create;
// launch the popup
URL = 'index.php?'
+ 'module=' + module_name
+ '&action=Popup';
if (metadata != '' && metadata != 'undefined') {
URL+='&metadata='+metadata;
}
// Bug #46842 : The relate field field_to_name_array fails to copy over custom fields
// post fields that should be populated from popup form
if(popup_request_data.jsonObject) {
var request_data = popup_request_data.jsonObject;
} else {
var request_data = popup_request_data;
}
var field_to_name_array_url = '';
if (request_data && request_data.field_to_name_array != 'undefined') {
for(var key in request_data.field_to_name_array) {
if ( key.toLowerCase() != 'id' ) {
field_to_name_array_url += '&field_to_name[]='+encodeURIComponent(key.toLowerCase());
}
}
if (initial_filter != '') {
URL += '&query=true' + initial_filter;
}
if (hide_clear_button) {
URL += '&hide_clear_button=true';
}
windowName = module_name + '_popup_window' + popupCount;
popupCount++;
windowFeatures = 'width=' + width
+ ',height=' + height
+ ',resizable=1,scrollbars=1';
if (popup_mode == '' && popup_mode == 'undefined') {
popup_mode = 'single';
}
URL += '&mode=' + popup_mode;
if (create == '' && create == 'undefined') {
create = 'false';
}
URL += '&create=' + create;
if (metadata != '' && metadata != 'undefined') {
URL += '&metadata=' + metadata;
}
// Bug #46842 : The relate field field_to_name_array fails to copy over custom fields
// post fields that should be populated from popup form
var request_data = [];
if (popup_request_data.jsonObject) {
request_data = popup_request_data.jsonObject;
} else {
request_data = popup_request_data;
}
var field_to_name_array_url = '';
if (request_data && request_data.field_to_name_array != 'undefined') {
for (var key in request_data.field_to_name_array) {
if (key.toLowerCase() != 'id') {
field_to_name_array_url += '&field_to_name[]=' + encodeURIComponent(key.toLowerCase());
}
}
if ( field_to_name_array_url ) {
URL+=field_to_name_array_url;
}
win = window.open(URL, windowName, windowFeatures);
}
if(window.focus)
{
// put the focus on the popup if the browser supports the focus() method
win.focus();
}
win.popupCount = popupCount;
if (field_to_name_array_url) {
URL += field_to_name_array_url;
}
return win;
win = window.open(URL, windowName, windowFeatures);
if (window.focus) {
// put the focus on the popup if the browser supports the focus() method
win.focus();
}
win.popupCount = popupCount;
return win;
}
/**
@ -135,114 +132,99 @@ function open_popup(module_name, width, height, initial_filter, close_popup, hid
* 1) form name to populate
* 2) associative array of input names to values for populating the form
*/
var from_popup_return = false;
function set_return(popup_reply_data)
{
from_popup_return = true;
var form_name = popup_reply_data.form_name;
var name_to_value_array = popup_reply_data.name_to_value_array;
for (var the_key in name_to_value_array)
{
if(the_key == 'toJSON')
{
/* just ignore */
}
else
{
var displayValue=name_to_value_array[the_key].replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\'').replace(/&quot;/gi,'"');;
if(window.document.forms[form_name] && window.document.forms[form_name].elements[the_key])
{
window.document.forms[form_name].elements[the_key].value = displayValue;
SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);
}
}
}
var from_popup_return = false;
function set_return(popup_reply_data) {
from_popup_return = true;
var form_name = popup_reply_data.form_name;
var name_to_value_array = popup_reply_data.name_to_value_array;
for (var the_key in name_to_value_array) {
if (the_key == 'toJSON') {
/* just ignore */
}
else {
var displayValue = name_to_value_array[the_key].replace(/&amp;/gi, '&').replace(/&lt;/gi, '<').replace(/&gt;/gi, '>').replace(/&#039;/gi, '\'').replace(/&quot;/gi, '"');
;
if (window.document.forms[form_name] && window.document.forms[form_name].elements[the_key]) {
window.document.forms[form_name].elements[the_key].value = displayValue;
SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);
}
}
}
}
function set_return_and_save(popup_reply_data)
{
var form_name = popup_reply_data.form_name;
var name_to_value_array = popup_reply_data.name_to_value_array;
for (var the_key in name_to_value_array)
{
if(the_key == 'toJSON')
{
/* just ignore */
}
else
{
window.document.forms[form_name].elements[the_key].value = name_to_value_array[the_key];
SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);
}
}
window.document.forms[form_name].return_module.value = window.document.forms[form_name].module.value;
window.document.forms[form_name].return_action.value = 'DetailView';
window.document.forms[form_name].return_id.value = window.document.forms[form_name].record.value;
window.document.forms[form_name].action.value = 'Save';
window.document.forms[form_name].submit();
function set_return_and_save(popup_reply_data) {
var form_name = popup_reply_data.form_name;
var name_to_value_array = popup_reply_data.name_to_value_array;
for (var the_key in name_to_value_array) {
if (the_key == 'toJSON') {
/* just ignore */
}
else {
window.document.forms[form_name].elements[the_key].value = name_to_value_array[the_key];
SUGAR.util.callOnChangeListers(window.document.forms[form_name].elements[the_key]);
}
}
window.document.forms[form_name].return_module.value = window.document.forms[form_name].module.value;
window.document.forms[form_name].return_action.value = 'DetailView';
window.document.forms[form_name].return_id.value = window.document.forms[form_name].record.value;
window.document.forms[form_name].action.value = 'Save';
window.document.forms[form_name].submit();
}
function set_return_and_save_targetlist(popup_reply_data)
{
var form_name = popup_reply_data.form_name;
var name_to_value_array = popup_reply_data.name_to_value_array;
var form_index = document.forms.length - 1;
sugarListView.get_checks();
var uids = document.MassUpdate.uid.value;
if (uids == '') {
return false;
}
/*
* Add the value returned from the popup to the form for submittal
*/
for (var the_key in name_to_value_array)
{
if(the_key == 'toJSON')
{
/* just ignore */
}
else
{
for ( i = form_index; i >= 0; i--)
{
if ( form_name == window.document.forms[form_index] )
{
form_index = i;
break;
}
}
window.document.forms[form_index].elements[get_element_index(form_index,the_key)].value = name_to_value_array[the_key];
SUGAR.util.callOnChangeListers(window.document.forms[form_index].elements[get_element_index(form_index,the_key)]);
}
}
function set_return_and_save_targetlist(popup_reply_data) {
var form_name = popup_reply_data.form_name;
var name_to_value_array = popup_reply_data.name_to_value_array;
var form_index = document.forms.length - 1;
sugarListView.get_checks();
var uids = document.MassUpdate.uid.value;
if (uids == '') {
return false;
}
/*
* Add the value returned from the popup to the form for submittal
*/
for (var the_key in name_to_value_array) {
if (the_key == 'toJSON') {
/* just ignore */
}
else {
for (i = form_index; i >= 0; i--) {
if (form_name == window.document.forms[form_index]) {
form_index = i;
break;
}
}
window.document.forms[form_index].elements[get_element_index(form_index, the_key)].value = name_to_value_array[the_key];
SUGAR.util.callOnChangeListers(window.document.forms[form_index].elements[get_element_index(form_index, the_key)]);
}
}
if(popup_reply_data.passthru_data.do_contacts)
{
var form = window.document.forms[form_index];
var do_contacts = $('<input type="hidden" name="do_contacts" value="1"/>');
$(form).append(do_contacts);
}
if (popup_reply_data.passthru_data.do_contacts) {
var form = window.document.forms[form_index];
var do_contacts = $('<input type="hidden" name="do_contacts" value="1"/>');
$(form).append(do_contacts);
}
window.document.forms[form_index].elements[get_element_index(form_index,"return_module")].value = window.document.forms[form_index].elements[get_element_index(form_index,"module")].value;
window.document.forms[form_index].elements[get_element_index(form_index,"return_action")].value = 'ListView';
window.document.forms[form_index].elements[get_element_index(form_index,"uids")].value = uids;
window.document.forms[form_index].submit();
window.document.forms[form_index].elements[get_element_index(form_index, "return_module")].value = window.document.forms[form_index].elements[get_element_index(form_index, "module")].value;
window.document.forms[form_index].elements[get_element_index(form_index, "return_action")].value = 'ListView';
window.document.forms[form_index].elements[get_element_index(form_index, "uids")].value = uids;
window.document.forms[form_index].submit();
}
function get_element_index(form_index,element_name) {
var j = 0;
while (j < window.document.forms[form_index].elements.length) {
if(window.document.forms[form_index].elements[j].name == element_name) {
index = j;
break;
}
j++;
}
return index;
function get_element_index(form_index, element_name) {
var j = 0;
while (j < window.document.forms[form_index].elements.length) {
if (window.document.forms[form_index].elements[j].name == element_name) {
index = j;
break;
}
j++;
}
return index;
}
@ -252,11 +234,10 @@ function get_element_index(form_index,element_name) {
* account_id and account_name field in the given form_name to use to
* construct the intial filter string.
*/
function get_initial_filter_by_account(form_name)
{
var account_id = window.document.forms[form_name].account_id.value;
var account_name = escape(window.document.forms[form_name].account_name.value);
var initial_filter = "&account_id=" + account_id + "&account_name=" + account_name;
function get_initial_filter_by_account(form_name) {
var account_id = window.document.forms[form_name].account_id.value;
var account_name = escape(window.document.forms[form_name].account_name.value);
var initial_filter = "&account_id=" + account_id + "&account_name=" + account_name;
return initial_filter;
return initial_filter;
}

View file

@ -498,6 +498,10 @@ var onSendAsTestClick = function(e, campaignId, marketingId) {
$('#show_wizard_summary').val('1');
$('#sendMarketingEmailSchedule').val('0');
$('#sendMarketingEmailTest').val('1');
if ($('#wizform input[name="marketing_id"]').length == 0) {
$('#wizform').append('<input type="hidden" name="marketing_id">');
}
$('#wizform input[name="marketing_id"]').val(marketingId);
$('#wizform').submit();
};

View file

@ -1,11 +1,11 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -16,7 +16,7 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
*
* 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
* 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
@ -34,9 +34,13 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ALLOW_ALL'=>'All',

View file

@ -1,11 +1,11 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
/**
*
* 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.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -16,7 +16,7 @@ if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
*
* 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
* 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
@ -34,9 +34,13 @@ if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ACCESS_ALL' => 'All',

View file

@ -1,11 +1,11 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -16,7 +16,7 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
*
* 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
* 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
@ -34,9 +34,13 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_MODULE_NAME' => 'Roles',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,38 +1,46 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2017 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
* 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. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
* 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,10 +1,11 @@
<?php
/**
*
* 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.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,14 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -1,10 +1,11 @@
<?php
/**
*
* 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.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,10 +34,14 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -1,27 +1,47 @@
<?php
/**
* Advanced OpenReports, SugarCRM Reporting.
* @package Advanced OpenReports for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* 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
* 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.
*
* @author SalesAgility <info@salesagility.com>
* 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ID' => 'ID',
'LBL_DATE_ENTERED' => 'Date Created',

View file

@ -1,27 +1,47 @@
<?php
/**
* Advanced OpenReports, SugarCRM Reporting.
* @package Advanced OpenReports for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* 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
* 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.
*
* @author SalesAgility <info@salesagility.com>
* 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ID' => 'ID',
'LBL_DATE_ENTERED' => 'Date Created',

View file

@ -1,27 +1,47 @@
<?php
/**
* Advanced OpenReports, SugarCRM Reporting.
* @package Advanced OpenReports for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* 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
* 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.
*
* @author SalesAgility <info@salesagility.com>
* 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ID' => 'ID',
'LBL_DATE_ENTERED' => 'Date Created',

View file

@ -1,10 +1,11 @@
<?php
/**
*
* 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.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,10 +34,14 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,29 +1,47 @@
<?php
/**
* Products, Quotations & Invoices modules.
* Extensions to SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* 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
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* @author Salesagility Ltd <support@salesagility.com>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_NAME' => 'Contract Manager',
'LBL_CONTRACT_ACCOUNT' => 'Account',

View file

@ -1,28 +1,47 @@
<?php
/**
* Advanced, robust set of sales and support modules.
* Extensions to OpenSales for SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* 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
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* @author Greg Soper <greg.soper@salesagility.com>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -1,28 +1,47 @@
<?php
/**
* Products, Quotations & Invoices modules.
* Extensions to SugarCRM
* @package Advanced OpenSales for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* 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
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* @author Salesagility Ltd <support@salesagility.com>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ID' => 'ID',
'LBL_MODULE_NAME' => 'Groups',

View file

@ -5,7 +5,7 @@
* 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.
* Copyright (C) 2011 - 2017 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
@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,8 +34,8 @@
* 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".
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!isset($_REQUEST['uid']) || empty($_REQUEST['uid']) || !isset($_REQUEST['templateID']) || empty($_REQUEST['templateID'])) {

View file

@ -1,29 +1,47 @@
<?php
/**
* Products, Quotations & Invoices modules.
* Extensions to SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* 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
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* @author Salesagility Ltd <support@salesagility.com>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -1,99 +1,142 @@
<?php
/**
* Products, Quotations & Invoices modules.
* Extensions to SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* 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
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* @author Salesagility Ltd <support@salesagility.com>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License 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".
*/
class sendEmail{
function send_email($module,$module_type,$printable,$file_name,$attach){
require_once('modules/Emails/Email.php');
global $current_user, $mod_strings, $sugar_config;
//First Create e-mail draft
$email = new Email();
// set the id for relationships
$email->id = create_guid();
$email->new_with_id = true;
//subject
$email->name = $mod_strings['LBL_EMAIL_NAME'].' '.$module->name;
//body
$email->description_html = $printable;
//type is draft
$email->type = "draft";
$email->status = "draft";
if(!empty($module->billing_contact_id) && $module->billing_contact_id!="")
require_once('modules/Emails/Email.php');
require_once('modules/Contacts/Contact.php');
/**
* Class sendEmail
* TODO: Move to emails module. This class violates single responsibility principle. In that the emails
* module should handle the email
*/
class sendEmail
{
/**
* @param SugarBean $module
* @param string $module_type
* @param string $printable
* @param string $file_name
* @param bool $attach
* @see generatePDF (Entrypoint)
* @deprecated use EmailController::composeViewFrom
*/
public function send_email($module, $module_type, $printable, $file_name, $attach)
{
global $current_user, $mod_strings, $sugar_config;
// First Create e-mail draft
$email = new Email();
// set the id for relationships
$email->id = create_guid();
$email->new_with_id = true;
// subject
$email->name = $mod_strings['LBL_EMAIL_NAME'] . ' ' . $module->name;
// body
$email->description_html = $printable;
// type is draft
$email->type = "draft";
$email->status = "draft";
if (!empty($module->billing_contact_id)) {
$contact_id = $module->billing_contact_id;
else if(!empty($module->contact_id) && $module->contact_id!="")
$contact_id = $module->contact_id;
require_once('modules/Contacts/Contact.php');
$contact = new Contact;
if($contact->retrieve($contact_id)){
$email->parent_type = 'Contacts';
$email->parent_id = $contact->id;
if(!empty($contact->email1)){
$email->to_addrs_emails = $contact->email1.";";
$email->to_addrs = $module->billing_contact_name." <".$contact->email1.">";
}
} else {
if (!empty($module->contact_id)) {
$contact_id = $module->contact_id;
}
}
//team id
$email->team_id = $current_user->default_team;
//assigned_user_id
$email->assigned_user_id = $current_user->id;
//Save the email object
global $timedate;
$email->date_start = $timedate->to_display_date_time(gmdate($GLOBALS['timedate']->get_db_date_time_format()));
$email->save(FALSE);
$email_id = $email->id;
if($attach)
{
$note = new Note();
$note->modified_user_id = $current_user->id;
$note->created_by = $current_user->id;
$note->name = $file_name;
$note->parent_type = 'Emails';
$note->parent_id = $email_id;
$note->file_mime_type = 'application/pdf';
$note->filename = $file_name;
$note->save();
rename($sugar_config['upload_dir'].'attachfile.pdf',$sugar_config['upload_dir'].$note->id);
}
//redirect
if($email_id=="") {
echo "Unable to initiate Email Client";
exit;
} else {
header("Location: index.php?action=Compose&module=Emails&return_module=".$module_type."&return_action=DetailView&return_id=".$_REQUEST['record']."&recordId=".$email_id);
}
}
// TODO: FIX UID / Inbound Email Account
$inboundEmailID = $current_user->getPreference('defaultIEAccount', 'Emails');
$email->mailbox_id = $inboundEmailID;
$contact = new Contact;
if ($contact->retrieve($contact_id)) {
$email->parent_type = 'Contacts';
$email->parent_id = $contact->id;
if (!empty($contact->email1)) {
$email->to_addrs_emails = $contact->email1 . ";";
$email->to_addrs = $contact->name . " <" . $contact->email1 . ">";
$email->to_addrs_names = $contact->name . " <" . $contact->email1 . ">";
$email->parent_name = $contact->name;
}
}
// team id
$email->team_id = $current_user->default_team;
// assigned_user_id
$email->assigned_user_id = $current_user->id;
// Save the email object
global $timedate;
$email->date_start = $timedate->to_display_date_time(gmdate($GLOBALS['timedate']->get_db_date_time_format()));
$email->save(false);
$email_id = $email->id;
if ($attach) {
$note = new Note();
$note->modified_user_id = $current_user->id;
$note->created_by = $current_user->id;
$note->name = $file_name;
$note->parent_type = 'Emails';
$note->parent_id = $email_id;
$note->file_mime_type = 'application/pdf';
$note->filename = $file_name;
$noteId = $note->save();
if($noteID !== false && !empty($noteId)) {
rename($sugar_config['upload_dir'] . 'attachfile.pdf', $sugar_config['upload_dir'] . $note->id);
$email->attachNote($note);
} else {
$GLOBALS['log']->error('AOS_PDF_Templates: Unable to save note');
}
}
// redirect
if (empty($email_id)) {
echo "Unable to initiate Email Client";
exit;
} else {
header('Location: index.php?action=ComposeViewWithPdfTemplate&module=Emails&return_module=' . $module_type . '&return_action=DetailView&return_id=' . $module->id . '&record=' . $email_id);
}
}
}
?>

View file

@ -76,6 +76,29 @@ $dictionary['AOS_PDF_Templates'] = array(
'options' => 'pdf_template_type_dom',
'studio' => 'visible',
),
'description' =>
array(
'name' => 'description',
'vname' => 'LBL_DESCRIPTION',
'type' => 'html',
'comment' => 'Full text of the note',
'rows' => '6',
'cols' => '80',
'required' => false,
'massupdate' => 0,
'no_default' => false,
'comments' => 'Full text of the note',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => false,
'reportable' => true,
'unified_search' => false,
'merge_filter' => 'disabled',
'size' => '20',
'studio' => 'visible',
),
'sample' =>
array (
'required' => '0',

View file

@ -1,10 +1,11 @@
<?php
/*********************************************************************************
/**
*
* 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 - 2014 Salesagility Ltd.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 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
@ -15,7 +16,7 @@
*
* 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
* 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
@ -33,9 +34,13 @@
* 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".
********************************************************************************/
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',

View file

@ -1,29 +1,47 @@
<?php
/**
* Products, Quotations & Invoices modules.
* Extensions to SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* 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
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* @author Salesagility Ltd <support@salesagility.com>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -1,29 +1,47 @@
<?php
/**
* Products, Quotations & Invoices modules.
* Extensions to SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* 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
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* @author Salesagility Ltd <support@salesagility.com>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -1,28 +1,47 @@
<?php
/**
* Advanced, robust set of sales and support modules.
* Extensions to OpenSales for SugarCRM
* @package Advanced OpenSales for SugarCRM
* @subpackage Products
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* 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
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* @author Greg Soper <greg.soper@salesagility.com>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -25,7 +25,7 @@ array (
),
6 =>
array (
'customCode' => '<input type="button" class="button" onClick="showPopup(\'email\');" value="{$MOD.LBL_EMAIL_QUOTE}">',
'customCode' => '<input type="button" class="button" onClick="showPopup(\'email\');return false;" value="{$MOD.LBL_EMAIL_QUOTE}">',
),
7 =>
array (

View file

@ -0,0 +1,45 @@
{*
/**
*
* 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 - 2017 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".
*/
*}
<script>
function showPopup(task) {ldelim}
alert('{$MOD.LBL_NO_TEMPLATE}');
{rdelim}
</script>

View file

@ -0,0 +1,114 @@
{*
/**
*
* 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 - 2017 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".
*/
*}
<div id="popupDiv_ara"
style="display:none;position:fixed;top: 39%; left: 41%;opacity:1;z-index:9999;background:#FFFFFF;">
<form id="popupForm" action="index.php?entryPoint=generatePdf" method="post">
<table style="border: #000 solid 2px; padding-left:40px; padding-right:40px; padding-top:10px; padding-bottom:10px; font-size:110%;">
<tr height="20">
<td colspan="2">
<b>{$APP.LBL_SELECT_TEMPLATE}:-</b>
</td>
</tr>
{foreach name=template from=$TEMPLATES key=templateKey item=template}
{if empty($template) == false}
{capture name=on_click_js assign=on_click_js}
document.getElementById('popupDivBack_ara').style.display='none';document.getElementById('popupDiv_ara').style.display='none';var form=document.getElementById('popupForm');if(form!=null){ldelim}form.templateID.value='{$template}';form.submit();{rdelim}else{ldelim}alert('Error!');{rdelim}
{/capture}
<tr height="20">
<td width="17" valign="center"><a href="#" onclick="{$on_click_js}">
<a href="#" onclick="{$on_click_js}">
<img src="themes/default/images/txt_image_inline.gif" width="16" height="16"/>
</a>
</td>
<td>
<a href="#" onclick="{$on_click_js}">
<b>{$APP_LIST_STRINGS.template_ddown_c_list.$template}</b>
</a>
</td>
</tr>
{/if}
{/foreach}
<input type="hidden" name="templateID" value=""/>
<input type="hidden" name="task" value="pdf"/>
<input type="hidden" name="module" value="{$FOCUS->module_name}"/>
<input type="hidden" name="uid" value="{$FOCUS->id}"/>
</form>
<tr style="height:10px;">
</tr>
<tr>
<td colspan="2">
<button style=" display: block;margin-left: auto;margin-right: auto" onclick="document.getElementById('popupDivBack_ara').style.display='none';document.getElementById('popupDiv_ara').style.display='none';return false;">
Cancel
</button>
</td>
</tr>
</table>
</div>
<div id="popupDivBack_ara" onclick="this.style.display='none';document.getElementById('popupDiv_ara').style.display='none';" style="top:0px;left:0px;position:fixed;height:100%;width:100%;background:#000000;opacity:0.5;display:none;vertical-align:middle;text-align:center;z-index:9998;">
</div>
<script>
{literal}
/**
*
* @param task
* @return {boolean}
* @see generatePdf (entrypoint)
*/
{/literal}
function showPopup(task) {ldelim}
var form = document.getElementById('popupForm');
var ppd = document.getElementById('popupDivBack_ara');
var ppd2 = document.getElementById('popupDiv_ara');
var totalTemplates = {$TOTAL_TEMPLATES}
if (totalTemplates === 1) {ldelim}
form.task.value = task;
form.templateID.value = '{$template}';
form.submit();
{rdelim} else if (form !== null && ppd !== null && ppd2 !== null) {ldelim}
ppd.style.display ='block';
ppd2.style.display ='block';
form.task.value = task;
{rdelim} else {ldelim}
alert('Error!');
{rdelim}
return false;
{rdelim}
</script>

View file

@ -1,132 +1,123 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Advanced OpenSales, Advanced, robust set of sales modules.
* @package Advanced OpenSales for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* 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
* 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.
*
* @author SalesAgility <info@salesagility.com>
* 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once('include/MVC/View/views/view.detail.php');
class AOS_QuotesViewDetail extends ViewDetail {
/**
* Class AOS_QuotesViewDetail
*/
class AOS_QuotesViewDetail extends ViewDetail
{
/**
* @var AOS_Quotes $bean;
*/
public $bean;
function __construct(){
parent::__construct();
}
/**
* AOS_QuotesViewDetail constructor.
*/
public function __construct()
{
parent::__construct();
}
/**
* @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
*/
function AOS_QuotesViewDetail(){
public function AOS_QuotesViewDetail()
{
$deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
if(isset($GLOBALS['log'])) {
if (isset($GLOBALS['log'])) {
$GLOBALS['log']->deprecated($deprecatedMessage);
}
else {
} else {
trigger_error($deprecatedMessage, E_USER_DEPRECATED);
}
self::__construct();
$this->__construct();
}
function display(){
$this->populateQuoteTemplates();
$this->displayPopupHtml();
parent::display();
}
public function display()
{
$this->populateQuoteTemplates();
$this->displayPopupHtml();
parent::display();
}
function populateQuoteTemplates(){
global $app_list_strings, $current_user;
protected function populateQuoteTemplates()
{
global $app_list_strings;
$sql = "SELECT id, name FROM aos_pdf_templates WHERE deleted=0 AND type='AOS_Quotes' AND active = 1";
$sql = "SELECT id, name FROM aos_pdf_templates WHERE deleted=0 AND type='AOS_Quotes' AND active = 1";
$res = $this->bean->db->query($sql);
$res = $this->bean->db->query($sql);
$app_list_strings['template_ddown_c_list'] = array();
while($row = $this->bean->db->fetchByAssoc($res)){
if($row['id']){
$app_list_strings['template_ddown_c_list'][$row['id']] = $row['name'];
while ($row = $this->bean->db->fetchByAssoc($res)) {
if ($row['id']) {
$app_list_strings['template_ddown_c_list'][$row['id']] = $row['name'];
}
}
}
}
}
function displayPopupHtml(){
global $app_list_strings,$app_strings, $mod_strings;
$templates = array_keys($app_list_strings['template_ddown_c_list']);
if($templates){
protected function displayPopupHtml()
{
global $app_list_strings, $app_strings, $mod_strings;
$templatesList = array_keys($app_list_strings['template_ddown_c_list']);
$template = new Sugar_Smarty();
$template->assign('APP_LIST_STRINGS', $app_list_strings);
$template->assign('APP', $app_strings);
$template->assign('MOD', $mod_strings);
$template->assign('FOCUS', $this->bean);
$template->assign('TEMPLATES', $templatesList);
echo ' <div id="popupDiv_ara" style="display:none;position:fixed;top: 39%; left: 41%;opacity:1;z-index:9999;background:#FFFFFF;">
<form id="popupForm" action="index.php?entryPoint=generatePdf" method="post">
<table style="border: #000 solid 2px;padding-left:40px;padding-right:40px;padding-top:10px;padding-bottom:10px;font-size:110%;" >
<tr height="20">
<td colspan="2">
<b>'.$app_strings['LBL_SELECT_TEMPLATE'].':-</b>
</td>
</tr>';
foreach($templates as $template){
if(!$template){
continue;
}
$template = str_replace('^','',$template);
$js = "document.getElementById('popupDivBack_ara').style.display='none';document.getElementById('popupDiv_ara').style.display='none';var form=document.getElementById('popupForm');if(form!=null){form.templateID.value='".$template."';form.submit();}else{alert('Error!');}";
echo '<tr height="20">
<td width="17" valign="center"><a href="#" onclick="'.$js.'"><img src="themes/default/images/txt_image_inline.gif" width="16" height="16" /></a></td>
<td><b><a href="#" onclick="'.$js.'">'.$app_list_strings['template_ddown_c_list'][$template].'</a></b></td></tr>';
}
echo ' <input type="hidden" name="templateID" value="" />
<input type="hidden" name="task" value="pdf" />
<input type="hidden" name="module" value="'.$_REQUEST['module'].'" />
<input type="hidden" name="uid" value="'.$this->bean->id.'" />
</form>
<tr style="height:10px;"><tr><tr><td colspan="2"><button style=" display: block;margin-left: auto;margin-right: auto" onclick="document.getElementById(\'popupDivBack_ara\').style.display=\'none\';document.getElementById(\'popupDiv_ara\').style.display=\'none\';return false;">Cancel</button></td></tr>
</table>
</div>
<div id="popupDivBack_ara" onclick="this.style.display=\'none\';document.getElementById(\'popupDiv_ara\').style.display=\'none\';" style="top:0px;left:0px;position:fixed;height:100%;width:100%;background:#000000;opacity:0.5;display:none;vertical-align:middle;text-align:center;z-index:9998;">
</div>
<script>
function showPopup(task){
var form=document.getElementById(\'popupForm\');
var ppd=document.getElementById(\'popupDivBack_ara\');
var ppd2=document.getElementById(\'popupDiv_ara\');
if('.count($templates).' == 1){
form.task.value=task;
form.templateID.value=\''.$template.'\';
form.submit();
}else if(form!=null && ppd!=null && ppd2!=null){
ppd.style.display=\'block\';
ppd2.style.display=\'block\';
form.task.value=task;
}else{
alert(\'Error!\');
}
}
</script>';
}
else{
echo '<script>
function showPopup(task){
alert(\''.$mod_strings['LBL_NO_TEMPLATE'].'\');
}
</script>';
}
}
}
?>
if ($templatesList) {
$template->assign('TOTAL_TEMPLATES', count($templatesList));
foreach ($templatesList as $t => $templatesListItem) {
$templatesList[$t] = str_replace('^', '', $templatesListItem);
}
echo $template->fetch('modules/AOS_Quotes/templates/showPopupWithTemplates.tpl');
} else {
echo $template->fetch('modules/AOS_Quotes/templates/showPopupWithOutTemplates.tpl');
}
}
}

View file

@ -16,7 +16,7 @@
*
* 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
* 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
@ -34,15 +34,14 @@
* 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".
*
* This file was contributed by diligent technology & business consulting GmbH <info@dtbc.eu>
*
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_ID' => 'ID',
'LBL_DATE_ENTERED' => 'Date Created',

View file

@ -1,27 +1,47 @@
<?php
/**
* Advanced OpenWorkflow, Automating SugarCRM.
* @package Advanced OpenWorkflow for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* 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
* 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.
*
* @author SalesAgility <info@salesagility.com>
* 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ID' => 'ID',

View file

@ -1,27 +1,47 @@
<?php
/**
* Advanced OpenWorkflow, Automating SugarCRM.
* @package Advanced OpenWorkflow for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* 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
* 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.
*
* @author SalesAgility <info@salesagility.com>
* 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

View file

@ -1,27 +1,47 @@
<?php
/**
* Advanced OpenWorkflow, Automating SugarCRM.
* @package Advanced OpenWorkflow for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2017 SalesAgility Ltd.
*
* 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
* 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.
*
* @author SalesAgility <info@salesagility.com>
* 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".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',

Some files were not shown because too many files have changed in this diff Show more