up conflict

This commit is contained in:
Ronald Q
2016-04-28 08:18:46 -04:00
21 changed files with 203 additions and 271 deletions

View File

@@ -133,7 +133,7 @@ function change_hash($command, $opts)
$workspace->close();
CLI::logging(pakeColor::colorize("Changed...", "ERROR") . "\n");
} catch (Exception $e) {
echo "> Error: ".CLI::error($e->getMessage()) . "\n";
echo "> Error: ".CLI::error(G::getErrorMessage($e)) . "\n";
}
}
}

View File

@@ -62,7 +62,7 @@ function run_create_translation($args, $opts)
echo "Updating labels for workspace " . pakeColor::colorize($workspace->name, "INFO") . "\n";
$translation->generateTransaltionMafe($lang);
} catch (Exception $e) {
echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n";
echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error(G::getErrorMessage($e)) . "\n";
}
}

View File

@@ -13,7 +13,7 @@ class labelsGmail
$labels = array_merge($labels, $labelsResponse->getLabels());
}
} catch (Exception $e) {
print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . $e->getMessage();
print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . G::getErrorMessage($e);
throw ($e);
}
return $labels;
@@ -37,7 +37,7 @@ class labelsGmail
try {
$message = $service->users_messages->modify($userId, $messageId, $mods);
} catch (Exception $e) {
print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . $e->getMessage();
print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . G::getErrorMessage($e);
throw ($e);
}
}
@@ -69,7 +69,7 @@ class labelsGmail
$messages = array_merge($messages, $messagesResponse->getMessages());
}
} catch (Exception $e) {
print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . $e->getMessage();
print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . G::getErrorMessage($e);
throw ($e);
}
} while ($pageToken);

View File

@@ -148,7 +148,7 @@ class pmDynaform
public function jsonr(&$json)
{
if(empty($json)){
if (empty($json)) {
return;
}
foreach ($json as $key => &$value) {
@@ -422,18 +422,22 @@ class pmDynaform
$oCriteria->add(AppDocumentPeer::APP_DOC_FIELDNAME, $json->name);
$oCriteria->add(ContentPeer::CON_CATEGORY, 'APP_DOC_FILENAME');
$oCriteria->add(ContentPeer::CON_LANG, $this->lang);
$oCriteria->addDescendingOrderByColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
$oCriteria->setLimit(1);
$rs = AppDocumentPeer::doSelectRS($oCriteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$links = array();
$labelsFromDb = array();
$appDocUids = array();
while ($rs->next()) {
$row = $rs->getRow();
$linkDownload = "../cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
array_push($links, $linkDownload);
array_push($labelsFromDb, $row["CON_VALUE"]);
$links[] = "../cases/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$labelsFromDb[] = $row["CON_VALUE"];
$appDocUids[] = $row["APP_DOC_UID"];
}
$json->data = new stdClass();
$json->data->value = $links;
$json->data->app_doc_uid = $appDocUids;
if (sizeof($labelsFromDb)) {
$json->data->label = G::json_encode($labelsFromDb);

View File

@@ -112,8 +112,9 @@ $(window).load(function () {
window.dynaform.getForms()[0].applySuccess();
window.dynaform.getForms()[0].prepareFormToPost();
form.submit();
} else {
return false;
}
return false;
};
if (triggerDebug === true) {
showdebug();

View File

@@ -396,6 +396,11 @@ try {
G::uploadFile( $arrayFileTmpName[$i], $sPathName, $sFileName );
//set variable for APP_DOC_UID
$aData["APP_DATA"][$oAppDocument->getAppDocFieldname()] = G::json_encode([$oAppDocument->getAppDocUid()]);
$aData["APP_DATA"][$oAppDocument->getAppDocFieldname() . "_label"] = G::json_encode([$oAppDocument->getAppDocFilename()]);
$oCase->updateCase($_SESSION['APPLICATION'], $aData);
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry = &PMPluginRegistry::getSingleton();

View File

@@ -190,12 +190,17 @@ try {
include (PATH_METHODS . 'processes/processes_webEntryValidate.php');
break;
case 'webEntry_delete':
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$form = $_REQUEST;
if(file_exists(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'])) {
unlink(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME']);
unlink($filter->validateInput(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" .
PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'], 'path'));
}
if(file_exists(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php")) {
unlink(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php");
unlink($filter->validateInput(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" .
PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php",
'path'));
}
$oProcessMap->webEntry($_REQUEST['PRO_UID']);
G::auditLog('WebEntry','Delete web entry ('.$form['FILENAME'].') in process "'.$resultProcess['PRO_TITLE'].'"');

View File

@@ -1728,12 +1728,13 @@ class Cases
* @param string $app_uid, Uid for case
* @param array $app_data, Data for case variables
* @param string $dyn_uid, Uid for dynaform
* @param string $del_index, Index for case
* @param string $usr_uid, Uid for user
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*/
public function setCaseVariables($app_uid, $app_data, $dyn_uid = null, $usr_uid)
public function setCaseVariables($app_uid, $app_data, $dyn_uid = null, $usr_uid ,$del_index = 0)
{
Validator::isString($app_uid, '$app_uid');
Validator::appUid($app_uid, '$app_uid');
@@ -1771,7 +1772,7 @@ class Cases
$_SESSION['USER_LOGGED'] = $usr_uid;
$case = new \Cases();
$fields = $case->loadCase($app_uid);
$fields = $case->loadCase($app_uid, $del_index);
$_POST['form'] = $app_data;
if (!is_null($dyn_uid) && $dyn_uid != '') {
@@ -1783,6 +1784,17 @@ class Cases
}
}
if (!is_null($dyn_uid) && $del_index > 0) {
//save data
$data = array();
$data['APP_NUMBER'] = $fields['APP_NUMBER'];
$data['APP_DATA'] = $fields['APP_DATA'];
$data['DEL_INDEX'] = $del_index;
$data['TAS_UID'] = $fields['TAS_UID'];;
$data['CURRENT_DYNAFORM'] = $dyn_uid;
$data['USER_UID'] = $usr_uid;
$data['PRO_UID'] = $fields['PRO_UID'];
}
$data['APP_DATA'] = array_merge($fields['APP_DATA'], $_POST['form']);
$case->updateCase($app_uid, $data);
}

View File

@@ -862,19 +862,20 @@ class Cases extends Api
* @param string $app_uid {@min 1}{@max 32}
* @param array $request_data
* @param string $dyn_uid {@from path}
* @param string $del_index {@from path}
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @url PUT /:app_uid/variable
*/
public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '')
public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '', $del_index = 0)
{
try {
$usr_uid = $this->getUserId();
$cases = new \ProcessMaker\BusinessModel\Cases();
$request_data = \ProcessMaker\Util\DateTime::convertDataToUtc($request_data);
$cases->setCaseVariables($app_uid, $request_data, $dyn_uid, $usr_uid);
$cases->setCaseVariables($app_uid, $request_data, $dyn_uid, $usr_uid, $del_index);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}

View File

@@ -18,6 +18,7 @@ use \ProcessMaker\Util\DateTime;
class Light extends Api
{
private $regexNull = '/^null$/i';
private $arrayFieldIso8601 = [
// request lists
'newerThan',
@@ -137,6 +138,10 @@ class Light extends Api
$oldestthan =''
) {
try {
if (preg_match($this->regexNull, $newerThan)) {
return [];
}
$dataList['userId'] = $this->getUserId();
$dataList['action'] = 'todo';
$dataList['paged'] = true;
@@ -230,6 +235,10 @@ class Light extends Api
$oldestthan =''
) {
try {
if (preg_match($this->regexNull, $newerThan)) {
return [];
}
$dataList['userId'] = $this->getUserId();
$dataList['action'] = 'draft';
$dataList['paged'] = true;
@@ -325,6 +334,10 @@ class Light extends Api
$oldestthan =''
) {
try {
if (preg_match($this->regexNull, $newerThan)) {
return [];
}
$dataList['userId'] = $this->getUserId();
$dataList['action'] = 'sent';
$dataList['paged'] = $paged;
@@ -426,6 +439,10 @@ class Light extends Api
$oldestthan = ''
) {
try {
if (preg_match($this->regexNull, $newerThan)) {
return [];
}
$dataList['userId'] = $this->getUserId();
$dataList['action'] = 'paused';
$dataList['paged'] = true;
@@ -519,6 +536,10 @@ class Light extends Api
$oldestthan =''
) {
try {
if (preg_match($this->regexNull, $newerThan)) {
return [];
}
$dataList['userId'] = $this->getUserId();
$dataList['action'] = 'unassigned';
$dataList['paged'] = false;