mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 08:17:18 +08:00
Squashed 'public/legacy/' changes from 7ce0eaf560..ace35f6573
ace35f6573 SuiteCRM 7.11.22 Release 0e1db16cf0 Fix #9297 - V8 API Auth issues on windows 3c3b2c7784 Fix #9293 - Error on audit save 58dd2e9dc6 Fix #9286 - EmailsComposeView.js Formatting a3636f3953 Fix #9269 - edit view jumps to tab with validation error upon save, if hidden 43e9079b0e Fix #9262 - Add the `Overview` label to Security Groups detailview 6503cca0ac Fixes #9257 Adjusting references and tests to reflect updated GoogleAPIalias 4d5baa12ff Implement PDF Selection git-subtree-dir: public/legacy git-subtree-split: ace35f6573ad384e4e7472684262684f5cf195ee
This commit is contained in:
parent
114b895b6d
commit
dd455a1c2d
30 changed files with 906 additions and 207 deletions
81
modules/Administration/PDF/Controller.php
Normal file
81
modules/Administration/PDF/Controller.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?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 - 2018 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".
|
||||
*/
|
||||
|
||||
namespace SuiteCRM\Modules\Administration\PDF;
|
||||
|
||||
use Exception;
|
||||
use SuiteCRM\Modules\Administration\PDF\MVC\Controller as AbstractController;
|
||||
use SuiteCRM\PDF\PDFConfigurator;
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Controller
|
||||
* @package SuiteCRM\Modules\Administration\PDF
|
||||
*/
|
||||
class Controller extends AbstractController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new PDFView());
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the configuration from a POST request.
|
||||
*
|
||||
* If called from ajax it will return a json.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function doSave(): void
|
||||
{
|
||||
$PDFEngine = filter_input(INPUT_POST, 'pdf-engine', FILTER_SANITIZE_STRING);
|
||||
|
||||
PDFConfigurator::make()
|
||||
->setEngine($PDFEngine)
|
||||
->save();
|
||||
|
||||
if ($this->isAjax()) {
|
||||
$this->yieldJson(['status' => 'success']);
|
||||
}
|
||||
|
||||
$this->redirect('index.php?module=Administration&action=index');
|
||||
}
|
||||
}
|
53
modules/Administration/PDF/MVC/Controller.php
Normal file
53
modules/Administration/PDF/MVC/Controller.php
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?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 - 2018 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".
|
||||
*/
|
||||
|
||||
namespace SuiteCRM\Modules\Administration\PDF\MVC;
|
||||
|
||||
use SuiteCRM\Search\UI\MVC\Controller as BaseController;
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract controller for the Search settings.
|
||||
*/
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
}
|
113
modules/Administration/PDF/MVC/View.php
Normal file
113
modules/Administration/PDF/MVC/View.php
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?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 - 2018 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".
|
||||
*/
|
||||
|
||||
namespace SuiteCRM\Modules\Administration\PDF\MVC;
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
|
||||
use LoggerManager;
|
||||
use SuiteCRM\PDF\PDFWrapper;
|
||||
use SuiteCRM\Search\UI\MVC\View as BaseView;
|
||||
use SuiteCRM\Utility\StringUtils;
|
||||
|
||||
/**
|
||||
* Class View holds utilities for rendering a template file.
|
||||
*/
|
||||
abstract class View extends BaseView
|
||||
{
|
||||
/**
|
||||
* Configures translations and global variables.
|
||||
*
|
||||
* Extend to assign more variable.
|
||||
*/
|
||||
public function preDisplay(): void
|
||||
{
|
||||
global $mod_strings, $app_list_strings, $app_strings, $sugar_config;
|
||||
|
||||
$errors = [];
|
||||
$this->smarty->assign('MOD', $mod_strings);
|
||||
$this->smarty->assign('APP', $app_strings);
|
||||
$this->smarty->assign('APP_LIST', $app_list_strings);
|
||||
$this->smarty->assign('LANGUAGES', get_languages());
|
||||
$this->smarty->assign('JAVASCRIPT', get_set_focus_js());
|
||||
$this->smarty->assign('error', $errors);
|
||||
$this->smarty->assign('BUTTONS', $this->getButtons());
|
||||
|
||||
if (empty($sugar_config['pdf'])) {
|
||||
LoggerManager::getLogger()->warn('Configuration does not contains default PDF settings.');
|
||||
}
|
||||
|
||||
$pdfSettings = $sugar_config['pdf'] ?? null;
|
||||
$this->smarty->assign('config', $pdfSettings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the cancel and save button.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getButtons(): string
|
||||
{
|
||||
global $mod_strings;
|
||||
global $app_strings;
|
||||
|
||||
$this->smarty->assign('MOD', $mod_strings);
|
||||
$this->smarty->assign('APP', $app_strings);
|
||||
|
||||
return $this->smarty->fetch('modules/Administration/PDF/buttons.tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an associative array with their class name and translated label
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getEngines(): array
|
||||
{
|
||||
$engines = [];
|
||||
|
||||
foreach (PDFWrapper::getEngines() as $engine) {
|
||||
$engines[$engine] = StringUtils::camelToTranslation($engine);
|
||||
}
|
||||
|
||||
return $engines;
|
||||
}
|
||||
}
|
89
modules/Administration/PDF/PDFView.php
Normal file
89
modules/Administration/PDF/PDFView.php
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?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 - 2021 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".
|
||||
*/
|
||||
|
||||
namespace SuiteCRM\Modules\Administration\PDF;
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
|
||||
use SuiteCRM\Modules\Administration\PDF\MVC\View as AbstractView;
|
||||
use SuiteCRM\PDF\PDFWrapper;
|
||||
|
||||
/**
|
||||
* Class View renders the PDF settings.
|
||||
*/
|
||||
class PDFView extends AbstractView
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(__DIR__ . '/view.tpl');
|
||||
}
|
||||
|
||||
public function preDisplay(): void
|
||||
{
|
||||
parent::preDisplay();
|
||||
|
||||
$this->smarty->assign('selectedController', PDFWrapper::getController());
|
||||
$this->smarty->assign('selectedEngine', PDFWrapper::getDefaultEngine());
|
||||
$engines = $this->getEngines();
|
||||
|
||||
$this->smarty->assign('engines', [
|
||||
translate('LBL_PDF_WRAPPER_ENGINES') => $engines
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SugarView::display()
|
||||
*/
|
||||
public function display(): void
|
||||
{
|
||||
global $mod_strings, $app_strings;
|
||||
|
||||
$this->smarty->assign('APP', $app_strings);
|
||||
$this->smarty->assign('MOD', $mod_strings);
|
||||
|
||||
$template = $this->templateFile;
|
||||
if (file_exists('custom/' . $this->templateFile)) {
|
||||
$template = 'custom/' . $this->templateFile;
|
||||
}
|
||||
|
||||
$this->smarty->display($template);
|
||||
}
|
||||
}
|
50
modules/Administration/PDF/buttons.tpl
Normal file
50
modules/Administration/PDF/buttons.tpl
Normal file
|
@ -0,0 +1,50 @@
|
|||
{*
|
||||
* 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 - 2021 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".
|
||||
*}
|
||||
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}"
|
||||
accessKey="{$APP.LBL_SAVE_BUTTON_KEY}"
|
||||
class="button primary"
|
||||
type="submit"
|
||||
name="save"
|
||||
onclick="return check_form('ConfigureSettings');"
|
||||
value="{$APP.LBL_SAVE_BUTTON_LABEL}">
|
||||
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}"
|
||||
onclick="document.location.href='index.php?module=Administration&action=index'"
|
||||
class="button"
|
||||
type="button"
|
||||
name="cancel"
|
||||
value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
|
84
modules/Administration/PDF/view.tpl
Normal file
84
modules/Administration/PDF/view.tpl
Normal file
|
@ -0,0 +1,84 @@
|
|||
{*
|
||||
* 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 - 2021 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".
|
||||
*}
|
||||
<h1>{sugar_translate label="LBL_PDF_HEADER"}</h1>
|
||||
|
||||
<form id="SearchSettings"
|
||||
name="ConfigureSettings"
|
||||
class="detail-view"
|
||||
enctype='multipart/form-data'
|
||||
method="POST"
|
||||
action="index.php?module=Administration&action=PDFSettings&do=Save">
|
||||
|
||||
<input type="hidden" name="module" value="Administration">
|
||||
|
||||
<div class="row">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">{$MOD.LBL_PDF_INTERFACE}</div>
|
||||
<div class="panel-body tab-content text-center">
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<div class="td-container">
|
||||
<div>
|
||||
<label for="pdf-engine">{sugar_translate label="LBL_PDF_OPTIONS"}</label>
|
||||
</div>
|
||||
<div>
|
||||
<small class="form-text text-muted">{sugar_translate label="LBL_PDF_OPTIONS_HELP"}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{html_options
|
||||
options=$engines
|
||||
selected=$selectedEngine
|
||||
id="pdf-engine"
|
||||
name="pdf-engine"
|
||||
class="form-control"
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{$JAVASCRIPT}
|
||||
|
||||
<div class="settings-buttons">
|
||||
{$BUTTONS}
|
||||
</div>
|
||||
</form>
|
||||
|
54
modules/Administration/PDFSettings.php
Normal file
54
modules/Administration/PDFSettings.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?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 - 2021 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".
|
||||
*/
|
||||
|
||||
use SuiteCRM\Modules\Administration\PDF\Controller;
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
|
||||
global $current_user;
|
||||
|
||||
if (!is_admin($current_user)) {
|
||||
sugar_die("Unauthorized access to administration.");
|
||||
}
|
||||
|
||||
$controller = new Controller();
|
||||
|
||||
$controller->handle();
|
|
@ -74,9 +74,10 @@ abstract class View extends BaseView
|
|||
$this->smarty->assign('error', $errors);
|
||||
$this->smarty->assign('BUTTONS', $this->getButtons());
|
||||
|
||||
if (!empty($sugar_config['search'])) {
|
||||
if (empty($sugar_config['search'])) {
|
||||
LoggerManager::getLogger()->warn('Configuration does not contains default search settings.');
|
||||
}
|
||||
|
||||
$search = $sugar_config['search'] ?? null;
|
||||
$this->smarty->assign('config', $search);
|
||||
}
|
||||
|
|
|
@ -967,6 +967,18 @@ $mod_strings = array(
|
|||
'LBL_ELASTIC_SEARCH_ENGINE' => 'Elasticsearch Engine',
|
||||
'LBL_SIMPLE_SQL_SEARCH_ENGINE' => 'Simple SQL Search Engine',
|
||||
|
||||
// SearchWrapper Settings
|
||||
'LBL_PDF_HEADER' => 'PDF Settings',
|
||||
'LBL_CHANGE_PDF_SETTINGS' => 'Change PDF Settings',
|
||||
'LBL_PDF_HEADER_DESC' => 'Manage your PDF preferences',
|
||||
'LBL_PDF_OPTIONS' => 'PDF Engine',
|
||||
'LBL_PDF_OPTIONS_HELP' => 'Select the PDF engine that users will be able to use.',
|
||||
'LBL_PDF_INTERFACE' => 'PDF Interface',
|
||||
|
||||
// PDF Engines Translations
|
||||
'LBL_PDF_WRAPPER_ENGINES' => 'PDF Engines',
|
||||
'LBL_MPDF_ENGINE' => 'MPDF Engine',
|
||||
|
||||
// Ajax Submit
|
||||
'LBL_AJAX_SUBMIT_FAIL' => 'An error has occurred while saving the settings.',
|
||||
);
|
||||
|
|
|
@ -109,6 +109,14 @@ $admin_option_defs['Administration']['oauth2_clients'] = array(
|
|||
'password'
|
||||
);
|
||||
|
||||
$admin_option_defs['Administration']['pdf'] = array(
|
||||
'PDF',
|
||||
'LBL_PDF_HEADER',
|
||||
'LBL_CHANGE_PDF_SETTINGS',
|
||||
'./index.php?module=Administration&action=PDFSettings',
|
||||
'system-settings'
|
||||
);
|
||||
|
||||
$admin_group_header[]= array('LBL_ADMINISTRATION_HOME_TITLE','',false,$admin_option_defs, 'LBL_ADMINISTRATION_HOME_DESC');
|
||||
|
||||
|
||||
|
@ -224,7 +232,6 @@ $admin_option_defs['Administration']['aos'] = array(
|
|||
'./index.php?module=Administration&action=AOSAdmin',
|
||||
'aos-settings'
|
||||
);
|
||||
|
||||
$admin_option_defs['Administration']['aop'] = array(
|
||||
'AOP',
|
||||
'LBL_AOP_SETTINGS',
|
||||
|
|
|
@ -100,30 +100,30 @@
|
|||
fields[$(this).attr('data-open-popup-email-address-field')] = 'qtip_bar_email_address';
|
||||
}
|
||||
|
||||
$.fn.EmailsComposeView.setEmailAddressFieldFromPopup = function(resultData) {
|
||||
var contact_name = resultData.name_to_value_array.qtip_bar_name;
|
||||
var contact_email_address = resultData.name_to_value_array.qtip_bar_email_address;
|
||||
$.fn.EmailsComposeView.setEmailAddressFieldFromPopup = function(resultData) {
|
||||
var contact_name = resultData.name_to_value_array.qtip_bar_name;
|
||||
var contact_email_address = resultData.name_to_value_array.qtip_bar_email_address;
|
||||
|
||||
if (trim(contact_email_address) !== '') {
|
||||
var formatted_email_address = '';
|
||||
if (trim(contact_name) !== '') {
|
||||
// use name <email address> format
|
||||
formatted_email_address = contact_name + ' <' + contact_email_address + '>';
|
||||
} else {
|
||||
// use email address
|
||||
formatted_email_address = contact_email_address;
|
||||
}
|
||||
if (trim(contact_email_address) !== '') {
|
||||
var formatted_email_address = '';
|
||||
if (trim(contact_name) !== '') {
|
||||
// use name <email address> format
|
||||
formatted_email_address = contact_name + ' <' + contact_email_address + '>';
|
||||
} else {
|
||||
// use email address
|
||||
formatted_email_address = contact_email_address;
|
||||
}
|
||||
|
||||
if (trim($(self.active_elementQTipBar).val()) === '') {
|
||||
$(self.active_elementQTipBar).val(formatted_email_address);
|
||||
} else {
|
||||
$(self.active_elementQTipBar).val(
|
||||
$(self.active_elementQTipBar).val() + ', ' +
|
||||
formatted_email_address
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (trim($(self.active_elementQTipBar).val()) === '') {
|
||||
$(self.active_elementQTipBar).val(formatted_email_address);
|
||||
} else {
|
||||
$(self.active_elementQTipBar).val(
|
||||
$(self.active_elementQTipBar).val() + ', ' +
|
||||
formatted_email_address
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var popupWindow = open_popup(
|
||||
$(this).attr('data-open-popup-module'),
|
||||
|
|
|
@ -1,15 +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 - 2018 SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2021 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
|
||||
|
@ -42,6 +38,10 @@ if (!defined('sugarEntry') || !sugarEntry) {
|
|||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* Description: Controller for the Import module
|
||||
|
@ -94,7 +94,7 @@ class ImportController extends SugarController
|
|||
$GLOBALS['FOCUS'] = $this->bean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function action_index()
|
||||
{
|
||||
$this->action_Step1();
|
||||
|
@ -128,24 +128,33 @@ class ImportController extends SugarController
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo json_encode($results);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
|
||||
public function action_RefreshMapping()
|
||||
{
|
||||
global $mod_strings;
|
||||
require_once('modules/Import/sources/ImportFile.php');
|
||||
require_once('modules/Import/views/view.confirm.php');
|
||||
require_once __DIR__ . '/../../modules/Import/sources/ImportFile.php';
|
||||
require_once __DIR__ . '/../../modules/Import/views/view.confirm.php';
|
||||
$v = new ImportViewConfirm();
|
||||
$fileName = $_REQUEST['importFile'];
|
||||
|
||||
if (isset($fileName) && strpos($fileName, '..') !== false) {
|
||||
LoggerManager::getLogger()->security('Directory navigation attack denied');
|
||||
return;
|
||||
}
|
||||
|
||||
$delim = $_REQUEST['delim'];
|
||||
if ($delim == '\t') {
|
||||
|
||||
if ($delim === '\t') {
|
||||
$delim = "\t";
|
||||
}
|
||||
|
||||
$enclosure = $_REQUEST['qualif'];
|
||||
$enclosure = html_entity_decode($enclosure, ENT_QUOTES);
|
||||
$hasHeader = isset($_REQUEST['header']) && !empty($_REQUEST['header']) ? true : false;
|
||||
$hasHeader = !empty($_REQUEST['header']);
|
||||
|
||||
$importFile = new ImportFile($fileName, $delim, $enclosure, false);
|
||||
$importFile->setHeaderRow($hasHeader);
|
||||
|
@ -175,10 +184,10 @@ class ImportController extends SugarController
|
|||
$if->setHeaderRow($has_header);
|
||||
$lv = new ImportListView($if, array('offset'=> $offset), $tableID);
|
||||
$lv->display(false);
|
||||
|
||||
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
|
||||
|
||||
public function action_Step1()
|
||||
{
|
||||
$fromAdminView = isset($_REQUEST['from_admin_wizard']) ? $_REQUEST['from_admin_wizard'] : false;
|
||||
|
@ -189,7 +198,7 @@ class ImportController extends SugarController
|
|||
$this->view = 'step2';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function action_Step2()
|
||||
{
|
||||
$this->view = 'step2';
|
||||
|
@ -214,17 +223,17 @@ class ImportController extends SugarController
|
|||
{
|
||||
$this->view = 'step4';
|
||||
}
|
||||
|
||||
|
||||
public function action_Last()
|
||||
{
|
||||
$this->view = 'last';
|
||||
}
|
||||
|
||||
|
||||
public function action_Undo()
|
||||
{
|
||||
$this->view = 'undo';
|
||||
}
|
||||
|
||||
|
||||
public function action_Error()
|
||||
{
|
||||
$this->view = 'error';
|
||||
|
@ -244,7 +253,7 @@ class ImportController extends SugarController
|
|||
{
|
||||
$this->view = 'extimport';
|
||||
}
|
||||
|
||||
|
||||
public function action_GetControl()
|
||||
{
|
||||
echo getControl($_REQUEST['import_module'], $_REQUEST['field_name']);
|
||||
|
|
|
@ -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 - 2018 SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2021 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
|
||||
|
@ -41,6 +38,10 @@ if (!defined('sugarEntry') || !sugarEntry) {
|
|||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* Description: view handler for step 3 of the import process
|
||||
|
@ -114,7 +115,7 @@ class ImportViewStep3 extends ImportView
|
|||
}
|
||||
|
||||
$delimiter = $this->getRequestDelimiter();
|
||||
|
||||
|
||||
$this->ss->assign("CUSTOM_DELIMITER", $delimiter);
|
||||
$this->ss->assign("CUSTOM_ENCLOSURE", (!empty($_REQUEST['custom_enclosure']) ? $_REQUEST['custom_enclosure'] : ""));
|
||||
|
||||
|
@ -122,6 +123,11 @@ class ImportViewStep3 extends ImportView
|
|||
|
||||
$uploadFileName = $_REQUEST['file_name'];
|
||||
|
||||
if (isset($uploadFileName) && strpos($uploadFileName, '..') !== false) {
|
||||
LoggerManager::getLogger()->security('Directory navigation attack denied');
|
||||
return;
|
||||
}
|
||||
|
||||
if (strpos($uploadFileName, 'phar://') !== false) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,46 +1,60 @@
|
|||
<?php
|
||||
|
||||
$module_name = 'SecurityGroups';
|
||||
$viewdefs[$module_name]['DetailView'] = array(
|
||||
'templateMeta' => array('form' => array('buttons'=>array('EDIT', 'DUPLICATE', 'DELETE',
|
||||
)),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30')
|
||||
),
|
||||
$viewdefs[$module_name]['DetailView'] =
|
||||
array(
|
||||
'templateMeta' =>
|
||||
array(
|
||||
'form' =>
|
||||
array(
|
||||
'buttons' =>
|
||||
array(
|
||||
'EDIT', 'DUPLICATE', 'DELETE',
|
||||
)),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
0 =>
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
|
||||
'panels' =>array(
|
||||
|
||||
array(
|
||||
'name',
|
||||
'assigned_user_name',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
'panels' =>
|
||||
array(
|
||||
'LBL_PANEL_OVERVIEW' =>
|
||||
array(
|
||||
0 =>
|
||||
array(
|
||||
'name',
|
||||
'assigned_user_name',
|
||||
),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
array(
|
||||
array(
|
||||
'name' => 'date_entered',
|
||||
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
|
||||
'label' => 'LBL_DATE_ENTERED',
|
||||
),
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'noninheritable',
|
||||
),
|
||||
array(
|
||||
'description',
|
||||
),
|
||||
)
|
||||
);
|
||||
array(
|
||||
array(
|
||||
'name' => 'date_entered',
|
||||
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
|
||||
'label' => 'LBL_DATE_ENTERED',
|
||||
),
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'noninheritable',
|
||||
),
|
||||
array(
|
||||
'description',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
|
|
@ -71,7 +71,7 @@ class GoogleApiKeySaverEntryPoint
|
|||
|
||||
/**
|
||||
*
|
||||
* @var Google_Client
|
||||
* @var Google\Client
|
||||
*/
|
||||
protected $client;
|
||||
|
||||
|
@ -85,10 +85,10 @@ class GoogleApiKeySaverEntryPoint
|
|||
*
|
||||
* @param User $current_user
|
||||
* @param array $sugar_config
|
||||
* @param Google_Client $client
|
||||
* @param Google\Client $client
|
||||
* @param array $request
|
||||
*/
|
||||
public function __construct(User $current_user, $sugar_config, Google_Client $client, $request)
|
||||
public function __construct(User $current_user, $sugar_config, Google\Client $client, $request)
|
||||
{
|
||||
$this->currentUser = $current_user;
|
||||
$this->sugarConfig = $sugar_config;
|
||||
|
@ -105,7 +105,7 @@ class GoogleApiKeySaverEntryPoint
|
|||
protected function handleEntryPoint()
|
||||
{
|
||||
$this->client->setApplicationName('SuiteCRM');
|
||||
$this->client->setScopes(Google_Service_Calendar::CALENDAR);
|
||||
$this->client->setScopes(Google\Service\Calendar::CALENDAR);
|
||||
if (!isset($this->sugarConfig['google_auth_json'])) {
|
||||
throw new Exception('google_auth_json requested variable is missing', 1);
|
||||
}
|
||||
|
|
|
@ -666,6 +666,10 @@ class User extends Person implements EmailInterface
|
|||
$this->portal_only = 0;
|
||||
}
|
||||
|
||||
// If the current user is not an admin, do not allow them to set the admin flag to true.
|
||||
if (!is_admin($current_user)) {
|
||||
$this->is_admin = 0;
|
||||
}
|
||||
|
||||
// set some default preferences when creating a new user
|
||||
$setNewUserPreferences = empty($this->id) || !empty($this->new_with_id);
|
||||
|
|
|
@ -53,5 +53,5 @@ if (!defined('sugarEntry') || !sugarEntry) {
|
|||
include_once __DIR__ . '/GoogleApiKeySaverEntryPoint.php';
|
||||
|
||||
global $current_user, $sugar_config;
|
||||
$client = new Google_Client();
|
||||
$client = new \Google\Client();
|
||||
new GoogleApiKeySaverEntryPoint($current_user, $sugar_config, $client, $_REQUEST);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue