Merged in bugfix/HOR-3612 (pull request #6190)
HOR-3612 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -185,6 +185,12 @@ class RBAC
|
|||||||
'processes_GetFile.php' => [
|
'processes_GetFile.php' => [
|
||||||
'mailTemplates' => ['PM_FACTORY'],
|
'mailTemplates' => ['PM_FACTORY'],
|
||||||
'public' => ['PM_FACTORY']
|
'public' => ['PM_FACTORY']
|
||||||
|
],
|
||||||
|
'tools/ajaxListener.php' => [
|
||||||
|
'getList' => ['PM_SETUP'],
|
||||||
|
'save' => ['PM_SETUP'],
|
||||||
|
'delete' => ['PM_SETUP'],
|
||||||
|
'rebuild' => ['PM_SETUP']
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
$this->aliasPermissions['PM_CASES'] = [self::PM_GUEST_CASE];
|
$this->aliasPermissions['PM_CASES'] = [self::PM_GUEST_CASE];
|
||||||
|
|||||||
@@ -1,41 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* tools/ajaxListener.php Ajax Listener for Cases rpc requests
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* 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 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/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
|
||||||
* @date Jan 10th, 2010
|
|
||||||
*/
|
|
||||||
|
|
||||||
$action = $_REQUEST['action'];
|
$action = $_REQUEST['action'];
|
||||||
unset($_REQUEST['action']);
|
unset($_REQUEST['action']);
|
||||||
|
|
||||||
|
global $RBAC;
|
||||||
|
$RBAC->allows(basename(dirname(__FILE__)) . PATH_SEP . basename(__FILE__), $action);
|
||||||
|
|
||||||
$ajax = new Ajax();
|
$ajax = new Ajax();
|
||||||
$ajax->$action($_REQUEST);
|
$ajax->$action($_REQUEST);
|
||||||
|
|
||||||
class Ajax
|
class Ajax
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the list related to the translation
|
||||||
|
*
|
||||||
|
* @param array $params
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function getList($params)
|
public function getList($params)
|
||||||
{
|
{
|
||||||
$search = isset($params['search']) ? $params['search'] : null;
|
$search = isset($params['search']) ? $params['search'] : null;
|
||||||
@@ -46,6 +29,11 @@ class Ajax
|
|||||||
echo G::json_encode($result);
|
echo G::json_encode($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save translation
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -53,6 +41,7 @@ class Ajax
|
|||||||
$label = preg_replace("[\n|\r|\n\r]", ' ', $_POST['label']);
|
$label = preg_replace("[\n|\r|\n\r]", ' ', $_POST['label']);
|
||||||
|
|
||||||
$res = Translation::addTranslation('LABEL', $id, 'en', $label);
|
$res = Translation::addTranslation('LABEL', $id, 'en', $label);
|
||||||
|
$result = new stdClass();
|
||||||
if ($res['codError'] < 0) {
|
if ($res['codError'] < 0) {
|
||||||
$result->success = false;
|
$result->success = false;
|
||||||
$result->msg = $res['message'];
|
$result->msg = $res['message'];
|
||||||
@@ -67,10 +56,16 @@ class Ajax
|
|||||||
print G::json_encode($result);
|
print G::json_encode($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete translation
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$ids = explode(',', $_POST['IDS']);
|
$ids = explode(',', $_POST['IDS']);
|
||||||
$category = 'LABEL';
|
$category = 'LABEL';
|
||||||
|
$result = new stdClass();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
@@ -89,8 +84,14 @@ class Ajax
|
|||||||
print G::json_encode($result);
|
print G::json_encode($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rebuild translation
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function rebuild()
|
public function rebuild()
|
||||||
{
|
{
|
||||||
|
$result = new stdClass();
|
||||||
try {
|
try {
|
||||||
$t = new Translation();
|
$t = new Translation();
|
||||||
$result = Translation::generateFileTranslation('en');
|
$result = Translation::generateFileTranslation('en');
|
||||||
|
|||||||
Reference in New Issue
Block a user