Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Victor Saisa Lopez
2014-02-26 09:12:18 -04:00
12 changed files with 415 additions and 67 deletions

View File

@@ -8,6 +8,8 @@
* @author Erik Amaru Ortiz * @author Erik Amaru Ortiz
*/ */
$rootPath = __DIR__;
$config = @parse_ini_file("workflow/engine/config/env.ini"); $config = @parse_ini_file("workflow/engine/config/env.ini");
$debug = !empty($config) && isset($config['debug']) ? $config['debug'] : 0; $debug = !empty($config) && isset($config['debug']) ? $config['debug'] : 0;
@@ -44,6 +46,7 @@ $projects = array(
out("build-vendor.php", 'purple'); out("build-vendor.php", 'purple');
out("generating files for ", 'purple', false); out("generating files for ", 'purple', false);
out( $debug ? 'debug' : 'production', 'success', false); out( $debug ? 'debug' : 'production', 'success', false);
out(" mode", 'purple'); out(" mode", 'purple');
@@ -76,6 +79,109 @@ foreach ($projects as $project) {
} }
//the script is completed if the option is Debug = 1
if ($debug) {
echo PHP_EOL;
die;
}
out("=> compresing and combining js files", 'info');
$jsFiles = array (
"workflow/public_html/lib/js/wz_jsgraphics.js",
"workflow/public_html/lib/js/jquery-1.10.2.min.js",
"workflow/public_html/lib/js/underscore-min.js",
"workflow/public_html/lib/js/jquery-ui-1.10.3.custom.min.js",
"workflow/public_html/lib/js/jquery.layout.min.js",
"workflow/public_html/lib/js/restclient.min.js",
"workflow/public_html/lib/pmUI/pmui.min.js",
"workflow/public_html/lib/mafe/mafe.min.js",
"workflow/public_html/lib/mafe/designer.min.js",
"gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmGrids/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js",
"gulliver/js/codemirror/lib/codemirror.js",
"gulliver/js/codemirror/mode/javascript/javascript.js",
"gulliver/js/codemirror/addon/edit/matchbrackets.js",
"gulliver/js/codemirror/mode/htmlmixed/htmlmixed.js",
"gulliver/js/codemirror/mode/xml/xml.js",
"gulliver/js/codemirror/mode/css/css.js",
"gulliver/js/codemirror/mode/clike/clike.js",
"gulliver/js/codemirror/mode/php/php.js",
);
$bigHandler = fopen ("{$rootPath}/workflow/public_html/lib/js/big.js", "w");
foreach ($jsFiles as $jsFile) {
$fileContent = file_get_contents("{$rootPath}/$jsFile");
fprintf($bigHandler, "%s\n\n", $fileContent);
printf (" - File %s added to big.js\n", basename($jsFile));
}
fclose ($bigHandler);
printf ( "big.js file has %d bytes\n", filesize("{$rootPath}/workflow/public_html/lib/js/big.js"));
out("=> compresing and combining css files", 'info');
$cssFiles = array (
"workflow/public_html/lib/pmUI/pmui.min.css",
"workflow/public_html/lib/mafe/mafe.min.css",
"gulliver/js/codemirror/lib/codemirror.css",
"gulliver/js/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css",
"gulliver/js/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css",
"gulliver/js/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css",
"gulliver/js/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css"
);
$bigHandler = fopen ("{$rootPath}/workflow/public_html/lib/css/big.css", "w");
foreach ($cssFiles as $cssFile) {
$fileContent = file_get_contents("{$rootPath}/$cssFile");
fprintf($bigHandler, "%s\n\n", $fileContent);
printf (" - File %s added to big.css\n", basename($cssFile));
}
fclose ($bigHandler);
printf ( "big.css file has %d bytes\n", filesize("{$rootPath}/workflow/public_html/lib/css/big.css"));
echo PHP_EOL; echo PHP_EOL;

View File

@@ -0,0 +1,96 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Files Manager Resources
Background:
Given that I have a valid access_token
Scenario: Get a list of main process files manager
Given I request "project/1265557095225ff5c688f46031700471/file-manager"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
Scenario: Get a list public folder of process files manager
Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=public"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
Scenario: Get a list templates folder of process files manager
Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=templates"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
Scenario Outline: Post files
Given POST this data:
"""
{
"prf_filename": "<file_name>",
"prf_path": "<path>",
"prf_content": "<content>"
}
"""
And I request "project/1265557095225ff5c688f46031700471/file-manager"
Then the response status code should be <http_code>
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "<type>"
And store "prf_uid" in session array as variable "prf_uid<i>"
Examples:
| test_description | file_name | path | content | http_code | type |
| into public folder | testbehat.txt | public/ | test | 200 | object |
| into maintemplates folder | testbehat.txt | templates/ | test | 200 | object |
| into public subfolder | testbehat.txt | public/test_folder | test | 200 | object |
| into public subfolder | testbehat.txt | templates/test_folder | test | 200 | object |
Scenario Outline: Post files
Given PUT this data:
"""
{
"prf_filename": "<file_name>",
"prf_content": "<content>"
}
"""
And I request "project/1265557095225ff5c688f46031700471/file-manager?path=<path>"
Then the response status code should be <http_code>
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "<type>"
Examples:
| test_description | file_name | path | content | http_code | type |
| put into public folder | testbehat.txt | public/ | put test | 200 | object |
| put into maintemplates folder | testbehat.txt | templates/ | put test | 200 | object |
| put into public subfolder | testbehat.txt | public/test_folder | put test | 200 | object |
| put into public subfolder | testbehat.txt | templates/test_folder | put test | 200 | object |
Scenario Outline: Delete file
Given that I want to delete a "<path>"
And I request "project/1265557095225ff5c688f46031700471/file-manager?path=<path>"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
Examples:
| test_description | path |
| delete public folder | public/testbehat.txt |
| delete maintemplates folder | templates/testbehat.txt |
| delete public subfolder | public/test_folder/testbehat.txt |
| delete public subfolder | templates/test_folder/testbehat.txt |
#Para que funcione este test, debe existir el archivo que se quiere subir
Scenario: Post files
Given POST I want to upload the file "/home/daniel/test.txt" to path "public". Url to create prf_uid "project/1265557095225ff5c688f46031700471/file-manager" and updload "project/1265557095225ff5c688f46031700471/file-manager/upload"
Scenario: Delete file
Given that I want to delete a "public/test.txt"
And I request "project/1265557095225ff5c688f46031700471/file-manager?path=public/test.txt"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"

View File

@@ -95,6 +95,27 @@ Feature: User Main Tests
| Create user Vacation | 5 | micaela | sanchez | micaela | micaela@gmail.com | sancjh #544 | 555-6652 | US | FL | MIA | 555-6655-555 | Gerencia | | 2016-02-15 | | VACATION | PROCESSMAKER_OPERATOR | sample | sample | | Create user Vacation | 5 | micaela | sanchez | micaela | micaela@gmail.com | sancjh #544 | 555-6652 | US | FL | MIA | 555-6655-555 | Gerencia | | 2016-02-15 | | VACATION | PROCESSMAKER_OPERATOR | sample | sample |
#Para que funcione este test, debe existir el archivo que se quiere subir
#GET /api/1.0/{workspace}/user/{usr_uid}
# Upload a image
Scenario: Upload a image
Given POST I want to upload the image "/home/daniel/pic3.jpg" to user "00000000000000000000000000000001". Url "user/"
# Upload a image
Scenario Outline: Upload a image
Given POST I want to upload the image "<usr_photo>" to user with the key "usr_uid" stored in session array as variable "usr_uid_<usr_number>". Url "user/"
Examples:
| Test_description | usr_number | usr_photo |
| Create without replaced by, calendar | 1 | /home/wendy/photo/pic1.jpg |
| Create without calendar | 2 | /home/wendy/photo/pic2.jpg |
| Create with all fields | 3 | /home/wendy/photo/pic3.jpg |
| Create user Inactive | 4 | ~/userPhoto/abcd.jpg |
| Create user Vacation | 5 | ~/userPhoto/abcd.jpg |
Scenario: Get the users List when there are exactly 63 users Scenario: Get the users List when there are exactly 63 users
And I request "users" And I request "users"
And the content type is "application/json" And the content type is "application/json"

View File

@@ -0,0 +1,52 @@
http://brayan.pmos.colosa.net/api/1.0/cochalo/project/444446641528a7318e16744023753627/activity/1077328655304fcfecdf879070119988
/step/609531574530b7a20dcb7c1053135698/trigger/899405570530ba201363cf9010087072
@ProcessMakerMichelangelo @RestAPI
Feature: Step update position
Scenario: List all the Sub Processs (result 0 Sub Processs)
Given that I have a valid access_token
And I request "project/106912358530c9b14ac15d3001790900/activity/467397212530c9b18435b87094293840/step/693874302530c9ba1734ad0026525748/trigger/659748303530c9b85af4d26007619346/before"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And that "step_position" is set to "3"
Scenario: Change order the step
Given that I have a valid access_token
And PUT this data:
"""
{
"st_type": "BEFORE",
"st_position": "1"
}
"""
And I request "project/106912358530c9b14ac15d3001790900/activity/467397212530c9b18435b87094293840/step/693874302530c9ba1734ad0026525748/trigger/659748303530c9b85af4d26007619346"
Then the response status code should be 200
Scenario: List all the Sub Processs (result 0 Sub Processs)
Given that I have a valid access_token
And I request "project/106912358530c9b14ac15d3001790900/activity/467397212530c9b18435b87094293840/step/693874302530c9ba1734ad0026525748/trigger/659748303530c9b85af4d26007619346/before"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And that "step_position" is set to "1"
Scenario: Change order the step
Given that I have a valid access_token
And PUT this data:
"""
{
"st_type": "BEFORE",
"st_position": "3"
}
"""
And I request "project/106912358530c9b14ac15d3001790900/activity/467397212530c9b18435b87094293840/step/693874302530c9ba1734ad0026525748/trigger/659748303530c9b85af4d26007619346"
Then the response status code should be 200
Scenario: List all the Sub Processs (result 0 Sub Processs)
Given that I have a valid access_token
And I request "project/106912358530c9b14ac15d3001790900/activity/467397212530c9b18435b87094293840/step/693874302530c9ba1734ad0026525748/trigger/659748303530c9b85af4d26007619346/before"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And that "step_position" is set to "3"

View File

@@ -1329,7 +1329,7 @@ class RestContext extends BehatContext
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$postUrl); curl_setopt($ch, CURLOPT_URL,$postUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr); curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('prf_filename'=>$sfile, "prf_path" => $path, "prf_content" => NULL)); curl_setopt($ch, CURLOPT_POSTFIELDS, array('prf_filename'=>$sfile, "prf_path" => $path, "prf_content" => null));
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch); $postResult = curl_exec($ch);
@@ -1359,6 +1359,7 @@ class RestContext extends BehatContext
{ {
$baseUrl = $this->getParameter('base_url'); $baseUrl = $this->getParameter('base_url');
$url = $baseUrl.$url.$usrUid."/image-upload"; $url = $baseUrl.$url.$usrUid."/image-upload";
$accesstoken = $this->getParameter('access_token'); $accesstoken = $this->getParameter('access_token');
$headr = array(); $headr = array();
$headr[] = 'Authorization: Bearer '.$accesstoken; $headr[] = 'Authorization: Bearer '.$accesstoken;
@@ -1369,8 +1370,36 @@ class RestContext extends BehatContext
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch); $postResult = curl_exec($ch);
if( $postResult === false)
{
//trigger_error(curl_error($ch));
throw new Exception("Image upload failed ($imageFile):\n\n"
. curl_error($ch));
}
curl_close($ch); curl_close($ch);
echo $postResult; echo $postResult;
} }
/**
* @Given /^POST I want to upload the image "([^"]*)" to user with the key "([^"]*)" stored in session array as variable "([^"]*)"\. Url "([^"]*)"$/
*/
public function postIWantToUploadTheImageToUserWithTheKeyStoredInSessionArrayAsVariableUsrUidUrl($imageFile, $varName, $sessionVarName, $url)
{
if (file_exists("session.data")) {
$sessionData = json_decode(file_get_contents("session.data"));
} else {
$sessionData = array();
}
if (!isset($sessionData->$sessionVarName) ) {
$varValue = '';
} else {
$varValue = $sessionData->$sessionVarName;
} }
$usrUid = $varValue;
$this->postIWantToUploadTheImageToUser($imageFile, $usrUid, $url);
}
}

View File

@@ -1,7 +1,7 @@
/* Reset */ /* Reset */
.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} .o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} .o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
.o2k7Skin table td {vertical-align:middle} .o2k7Skin table td {vertical-align:top; background-color: white;}
/* Containers */ /* Containers */
.o2k7Skin table {background:transparent} .o2k7Skin table {background:transparent}

26
update Executable file
View File

@@ -0,0 +1,26 @@
echo "<h1>Michelangelo Update</h1><h2>Changelog Processmaker</h2><code>" > temp.txt
git pull
git log -n 20 --relative-date --graph --format=short >> temp.txt
cd vendor/colosa/pmUI
echo "</code><br><h2>Changelog pmUI</h2><br><code>" >> ../../../temp.txt
git pull
git log -n 20 --relative-date --graph --format=short >> ../../../temp.txt
cd ../MichelangeloFE
echo "</code><br><h2>Changelog MichelangeloFE</h2><br><code>" >> ../../../temp.txt
git pull
git log -n 20 --relative-date --graph --format=short >> ../../../temp.txt
cd ../../../
echo "</code><br><h2>build-vendor.php</h2><br><code>" >> temp.txt
php build-vendor.php >> temp.txt
sed ':a;N;$!ba;s/\n/<br>/g' temp.txt > workflow/public_html/build-log.html
echo "update executed succesfully, check the log in http://<server>/build-log.html "

View File

@@ -92,7 +92,8 @@ class FilesManager
} else { } else {
$editable = 'false'; $editable = 'false';
} }
$aTheFiles[] = array( 'prf_filename' => $aFile['FILE'], $aTheFiles[] = array( 'prf_uid' => $oProcessFiles->getPrfUid(),
'prf_filename' => $aFile['FILE'],
'usr_uid' => $oProcessFiles->getUsrUid(), 'usr_uid' => $oProcessFiles->getUsrUid(),
'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(), 'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(),
'prf_path' => $sMainDirectory. PATH_SEP .$sSubDirectory, 'prf_path' => $sMainDirectory. PATH_SEP .$sSubDirectory,
@@ -103,7 +104,8 @@ class FilesManager
'prf_content' => $fcontent); 'prf_content' => $fcontent);
} else { } else {
$aTheFiles[] = array('prf_filename' => $aFile['FILE'], $aTheFiles[] = array('prf_uid' => $oProcessFiles->getPrfUid(),
'prf_filename' => $aFile['FILE'],
'usr_uid' => '', 'usr_uid' => '',
'prf_update_usr_uid' => '', 'prf_update_usr_uid' => '',
'prf_path' => $sMainDirectory. PATH_SEP .$sSubDirectory, 'prf_path' => $sMainDirectory. PATH_SEP .$sSubDirectory,
@@ -403,44 +405,41 @@ class FilesManager
/** /**
* *
* @param string $sProcessUID {@min 32} {@max 32} * @param string $sProcessUID {@min 32} {@max 32}
* @param string $path * @param string $prfUid {@min 32} {@max 32}
* *
* *
* @access public * @access public
*/ */
public function downloadProcessFilesManager($sProcessUID, $path) public function downloadProcessFilesManager($sProcessUID, $prfUid)
{ {
try { try {
$sMainDirectory = current(explode("/", $path)); $path = '';
if ($sMainDirectory != 'public' && $sMainDirectory != 'templates') { $criteria = new \Criteria("workflow");
throw (new \Exception( 'invalid value specified for `prf_path`. Expecting `templates/` or `public/`')); $criteria->addSelectColumn(\ProcessFilesPeer::PRF_PATH);
$criteria->add(\ProcessFilesPeer::PRF_UID, $prfUid, \Criteria::EQUAL);
$rsCriteria = \ProcessFilesPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
while ($aRow = $rsCriteria->getRow()) {
$path = $aRow['PRF_PATH'];
$rsCriteria->next();
} }
if ($sMainDirectory == 'templates') { if ($path == ''){
$sMainDirectory = 'mailTemplates'; throw new \Exception('invalid value specified for `prf_uid`.');
} }
$sfile = end(explode("/",$path)); $sFile = end(explode("/",$path));
$sSubDirectorytemp = substr($path, strpos($path, "/")+1); $sPath = str_replace($sFile,'',$path);
if (strstr($sSubDirectorytemp,'/')) { $sSubDirectory = str_replace('/','',str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))));
$sSubDirectory = str_replace('/'.$sfile,"",$sSubDirectorytemp); $sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath);
$sSubDirectoryCheck = str_replace($sfile,"",$sSubDirectorytemp); if ($sMainDirectory == PATH_DATA_MAILTEMPLATES){
$sMainDirectory = 'mainTemplates';
} else { } else {
$sSubDirectory = ''; $sMainDirectory = 'public';
$sSubDirectoryCheck = '';
} }
switch ($sMainDirectory) { if (file_exists($path)) {
case 'mailTemplates':
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectoryCheck . $sfile;
break;
case 'public':
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectoryCheck . $sfile;
break;
default:
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sfile;
break;
}
if (file_exists(PATH_SEP.$sDirectory)) {
$oProcessMap = new \processMap(new \DBConnection()); $oProcessMap = new \processMap(new \DBConnection());
$oProcessMap->downloadFile($sProcessUID,$sMainDirectory,$sSubDirectory,$sfile); $oProcessMap->downloadFile($sProcessUID,$sMainDirectory,$sSubDirectory,$sFile);
die();
} else { } else {
throw (new \Exception( 'invalid value specified for `path`.')); throw (new \Exception( 'invalid value specified for `path`.'));
} }

View File

@@ -115,18 +115,17 @@ class Trigger
throw (new \Exception(str_replace(array("{0}", "{1}"), array($stepUid . ", " . $type . ", " . $taskUid . ", " . $triggerUid, "STEP_TRIGGER"), "The record \"{0}\", exists in table {1}"))); throw (new \Exception(str_replace(array("{0}", "{1}"), array($stepUid . ", " . $type . ", " . $taskUid . ", " . $triggerUid, "STEP_TRIGGER"), "The record \"{0}\", exists in table {1}")));
} }
if (isset($arrayData["st_position"]) && $this->existsRecord($stepUid, $type, $taskUid, "", $arrayData["st_position"])) {
throw (new \Exception(str_replace(array("{0}", "{1}", "{2}"), array($arrayData["st_position"], $stepUid . ", " . $type . ", " . $taskUid . ", " . $arrayData["st_position"], "STEP_TRIGGER"), "The \"{0}\" position for the record \"{1}\", exists in table {2}")));
}
//Create //Create
$stepTrigger = new \StepTrigger(); $stepTrigger = new \StepTrigger();
$posIni = $stepTrigger->getNextPosition($stepUid, $type, $taskUid);
$stepTrigger->create(array("STEP_UID" => $stepUid, "TAS_UID" => $taskUid, "TRI_UID" => $triggerUid, "ST_TYPE" => $type)); $stepTrigger->createRow(array(
"STEP_UID" => $stepUid,
if (!isset($arrayData["st_position"]) || $arrayData["st_position"] == "") { "TAS_UID" => $taskUid,
$arrayData["st_position"] = $stepTrigger->getNextPosition($stepUid, $type, $taskUid) - 1; "TRI_UID" => $triggerUid,
} "ST_TYPE" => $type,
"ST_CONDITION" => (isset($arrayData['st_condition'])) ? $arrayData['st_condition'] : '',
"ST_POSITION" => $posIni
));
$arrayData = $this->update($stepUidIni, $typeIni, $taskUid, $triggerUid, $arrayData); $arrayData = $this->update($stepUidIni, $typeIni, $taskUid, $triggerUid, $arrayData);

View File

@@ -116,15 +116,15 @@ class FilesManager extends Api
/** /**
* @param string $prjUid {@min 32} {@max 32} * @param string $prjUid {@min 32} {@max 32}
* @param string $path * @param string $prfUid {@min 32} {@max 32}
* *
* @url GET /:prjUid/file-manager/download * @url GET /:prjUid/file-manager/:prfUid/download
*/ */
public function doGetProcessFilesManagerDownload($prjUid, $path) public function doGetProcessFilesManagerDownload($prjUid, $prfUid)
{ {
try { try {
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \BusinessModel\FilesManager();
$filesManager->downloadProcessFilesManager($prjUid, $path); $filesManager->downloadProcessFilesManager($prjUid, $prfUid);
} catch (\Exception $e) { } catch (\Exception $e) {
//response //response
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());

View File

@@ -38,29 +38,6 @@
{foreach from=$designerCacheFile item=file} {foreach from=$designerCacheFile item=file}
<script type="text/javascript" src="/lib-dev/mafe/{$file}"></script> <script type="text/javascript" src="/lib-dev/mafe/{$file}"></script>
{/foreach} {/foreach}
{else}
<link rel="stylesheet" type="text/css" href="/lib/pmUI/pmui.css" />
<link rel="stylesheet" type="text/css" href="/lib/mafe/mafe.css" />
<link rel="stylesheet" type="text/css" href="/lib/css/jquery.layout.css" />
<link rel="stylesheet" type="text/css" href="/lib/css/jquery-ui-1.10.3.custom.min.css" />
<!--<link rel="stylesheet" type="text/css" href="/lib/css/jquery.dataTables.css">-->
<script type="text/javascript">
var prj_uid = "{$prj_uid}";
var credentials = "{$credentials}";
</script>
<script type="text/javascript" src="/lib/js/wz_jsgraphics.js"></script>
<script type="text/javascript" src="/lib/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/lib/js/underscore-min.js"></script>
<script type="text/javascript" src="/lib/js/jquery-ui-1.10.3.custom.min.js"></script>
<script type="text/javascript" src="/lib/js/jquery.layout.min.js"></script>
<script type="text/javascript" src="/lib/js/restclient.min.js"></script>
<!--<script type="text/javascript" src="/lib/js/jquery.dataTables.min.js"></script>-->
<script type="text/javascript" src="/lib/pmUI/pmui.min.js"></script>
<script type="text/javascript" src="/lib/mafe/mafe.min.js"></script>
<script type="text/javascript" src="/lib/mafe/designer.min.js"></script>
{/if}
<!-- tinyMCE --> <!-- tinyMCE -->
<script type="text/javascript" src="/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript" src="/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
@@ -76,7 +53,50 @@
<script type="text/javascript" src="/js/codemirror/mode/css/css.js"></script> <script type="text/javascript" src="/js/codemirror/mode/css/css.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/clike/clike.js"></script> <script type="text/javascript" src="/js/codemirror/mode/clike/clike.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/php/php.js"></script> <script type="text/javascript" src="/js/codemirror/mode/php/php.js"></script>
{else}
<link rel="stylesheet" type="text/css" href="/lib/css/big.css" />
<!-- <!--
<link rel="stylesheet" type="text/css" href="/js/codemirror/doc/docs.css"/> <link rel="stylesheet" type="text/css" href="/lib/pmUI/pmui.min.css" />
<link rel="stylesheet" type="text/css" href="/lib/mafe/mafe.min.css" />
<link rel="stylesheet" type="text/css" href="/lib/css/jquery.layout.css" />
<link rel="stylesheet" type="text/css" href="/lib/css/jquery-ui-1.10.3.custom.min.css" />
!-->
<!--<link rel="stylesheet" type="text/css" href="/lib/css/jquery.dataTables.css">-->
<script type="text/javascript">
var prj_uid = "{$prj_uid}";
var credentials = "{$credentials}";
</script>
<script type="text/javascript" src="/lib/js/big.js"></script>
<!--
<script type="text/javascript" src="/lib/js/wz_jsgraphics.js"></script>
<script type="text/javascript" src="/lib/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/lib/js/underscore-min.js"></script>
<script type="text/javascript" src="/lib/js/jquery-ui-1.10.3.custom.min.js"></script>
<script type="text/javascript" src="/lib/js/jquery.layout.min.js"></script>
<script type="text/javascript" src="/lib/js/restclient.min.js"></script>
<script type="text/javascript" src="/lib/pmUI/pmui.min.js"></script>
<script type="text/javascript" src="/lib/mafe/mafe.min.js"></script>
<script type="text/javascript" src="/lib/mafe/designer.min.js"></script>
<script type="text/javascript" src="/lib/js/tiny_mce.js"></script>
<script type="text/javascript" src="/js/codemirror/lib/codemirror.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/javascript/javascript.js"></script>
<script type="text/javascript" src="/js/codemirror/addon/edit/matchbrackets.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/xml/xml.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/css/css.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/clike/clike.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/php/php.js"></script>
<link rel="stylesheet" type="text/css" href="/js/codemirror/lib/codemirror.css"/>
!--> !-->
{/if}