Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #10397 - Surveys - hardcoded values #10398

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions include/EditView/EditView2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 - 2018 SalesAgility Ltd.
* Copyright (C) 2011 - 2024 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
Expand Down Expand Up @@ -507,7 +507,7 @@ protected function getPanelWithFillers($panel)
*/
public function process($checkFormName = false, $formName = '')
{
global $app_list_strings;
global $app_list_strings, $mod_strings;;

//the retrieve already did this work;
//$this->focus->fill_in_relationship_fields();
Expand Down Expand Up @@ -681,9 +681,14 @@ public function process($checkFormName = false, $formName = '')
}

if (empty($this->fieldDefs[$name]['value'])) {
$this->fieldDefs[$name]['value'] = $value;
}

if ($this->fieldDefs[$name]['type'] === 'varchar'
&& !empty($this->fieldDefs[$name]['default'])
&& !empty($mod_strings[$this->fieldDefs[$name]['default']])) {
$this->fieldDefs[$name]['value'] = $mod_strings[$this->fieldDefs[$name]['default']];
}
} else {
$this->fieldDefs[$name]['value'] = $value;
}

// 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
Expand Down
5 changes: 4 additions & 1 deletion modules/Surveys/language/en_us.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 - 2019 SalesAgility Ltd.
* Copyright (C) 2011 - 2024 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
Expand Down Expand Up @@ -105,4 +105,7 @@
'LBL_SUBMIT' => 'Submit',
'LBL_STARS' => 'Stars',
'LBL_SURVEY_CLOSE_RESPONSE' => 'Thanks for your interest but this survey is now closed.',
'LBL_SATISFIED_RESPONSE' => 'Satisfied',
'LBL_NOT_SATISFIED_NOR_DISSATISFIED' => 'Neither Satisfied nor Dissatisfied',
'LBL_DISSATISFIED' => 'Dissatisfied',
);
14 changes: 9 additions & 5 deletions modules/Surveys/vardefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 - 2018 SalesAgility Ltd.
* Copyright (C) 2011 - 2024 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
Expand Down Expand Up @@ -38,6 +38,10 @@
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/

if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}

$dictionary['Surveys'] = array(
'table' => 'surveys',
'audited' => true,
Expand Down Expand Up @@ -111,31 +115,31 @@
'vname' => 'LBL_SUBMIT_TEXT',
'type' => 'varchar',
'massupdate' => 0,
'default' => 'Submit',
'default' => 'LBL_SUBMIT',
),
'satisfied_text' => array(
'required' => false,
'name' => 'satisfied_text',
'vname' => 'LBL_SATISFIED_TEXT',
'type' => 'varchar',
'massupdate' => 0,
'default' => 'Satisfied',
'default' => 'LBL_SATISFIED_RESPONSE',
),
'neither_text' => array(
'required' => false,
'name' => 'neither_text',
'vname' => 'LBL_NEITHER_TEXT',
'type' => 'varchar',
'massupdate' => 0,
'default' => 'Neither Satisfied nor Dissatisfied',
'default' => 'LBL_NOT_SATISFIED_NOR_DISSATISFIED',
),
'dissatisfied_text' => array(
'required' => false,
'name' => 'dissatisfied_text',
'vname' => 'LBL_DISSATISFIED_TEXT',
'type' => 'varchar',
'massupdate' => 0,
'default' => 'Dissatisfied',
'default' => 'LBL_DISSATISFIED',
),
"surveys_surveyquestions" => array(
'name' => 'surveys_surveyquestions',
Expand Down