Merge branch 'master' of bitbucket.org:marcoAntonioNina/processmaker into dashboards2

This commit is contained in:
Marco Antonio Nina Mena
2015-05-27 10:05:56 -04:00
17 changed files with 245 additions and 75 deletions

View File

@@ -602,11 +602,12 @@ class Propel {
foreach (self::$connectionMap as $cnn) {
if (get_class($cnn) != "DBArrayConnection") {
if (gettype($cnn->getResource()) == "resource" && $cnn->isConnected() && $cnn->lastQuery != $lastQuery) {
$cnn->close();
if(isset($cnn->lastQuery)){
if (gettype($cnn->getResource()) == "resource" && $cnn->isConnected() && $cnn->lastQuery != $lastQuery) {
$cnn->close();
}
$lastQuery = $cnn->lastQuery;
}
$lastQuery = $cnn->lastQuery;
}
}
}

View File

@@ -75,6 +75,7 @@ CLI::taskOpt("multiple", "Restore from multiple compresed enumerated files.", "m
CLI::taskOpt("workspace", "Select which workspace to restore if multiple workspaces are present in the archive.",
"w:", "workspace=");
CLI::taskOpt("lang", "You must specify language on which rebuild of the case cache list builder will be done; if you don't specify this, it will use 'en' by default", "l:","lang=");
CLI::taskOpt("port", "You must specify mysql port.", "p:");
CLI::taskRun("run_workspace_restore");
CLI::taskName('cacheview-repair');
@@ -507,6 +508,7 @@ function run_workspace_restore($args, $opts) {
}
$info = array_key_exists("info", $opts);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
$port = array_key_exists("port", $opts) ? $opts['port'] : '';
if ($info) {
workspaceTools::getBackupInfo($filename);
} else {
@@ -534,7 +536,7 @@ function run_workspace_restore($args, $opts) {
CLI::error("Please, you should use -m parameter to restore them.\n");
return;
}
workspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang);
workspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang, $port );
}
}
}

View File

@@ -968,7 +968,7 @@ class Processes
}
}
}
if (isset($oData->taskExtraProperties)) {
foreach ($oData->taskExtraProperties as $key => $value) {
$record = $value;
@@ -3642,8 +3642,12 @@ class Processes
//Calculating the maximum length of file name
$pathLength = strlen( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP );
$length = strlen( $proTitle ) + $pathLength;
if ($length >= 250) {
$proTitle = myTruncate( $proTitle, 250 - $pathLength, '_', '' );
$limit = 200;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$limit = 150;
}
if ($length >= $limit) {
$proTitle = $this->truncateName($proTitle);
}
$index = '';
@@ -3751,9 +3755,9 @@ class Processes
}
}
//For public files
// for public files
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP . $data->process['PRO_UID'];
//Get WebEntry file names
$arrayWebEntryFile = array();
@@ -4126,6 +4130,7 @@ class Processes
$fsData = intval( fread( $fp, 9 ) ); //reading the size of $oData
$contents = fread( $fp, $fsData ); //reading string $oData
$path = PATH_DYNAFORM . $oData->process['PRO_UID'] . PATH_SEP;
if (! is_dir( $path )) {
G::verifyPath( $path, true );
@@ -4245,7 +4250,7 @@ class Processes
if ($fsContent > 0) {
$fileContent = fread( $fp, $fsContent ); //reading string $XmlContent
$newFileName = $pathPublic . $sFileName;
if (in_array($sFileName, $arrayWebEntryFile)) {
continue;
}
@@ -4262,6 +4267,7 @@ class Processes
fclose( $fp );
return true;
}
/**
@@ -5161,6 +5167,18 @@ class Processes
throw $e;
}
}
public function truncateName($proTitle)
{
$proTitle = str_replace(".","_",$proTitle);
$limit = 200;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$limit = 150;
}
$excess = strlen($proTitle) - $limit;
$proTitle = substr($proTitle,0,strlen($proTitle)-$excess);
return $proTitle;
}
}
//end class processes

View File

@@ -1371,6 +1371,8 @@ class workspaceTools
mysql_select_db($database);
$script = file_get_contents($filename);
//Replace TYPE by ENGINE
$script = preg_replace('/\)TYPE\=|\)\sTYPE\=/', ')ENGINE=', $script);
$lines = explode("\n", $script);
$previous = null;
$insert = false;
@@ -1502,7 +1504,7 @@ class workspaceTools
* @param string $newWorkspaceName if defined, supplies the name for the
* workspace to restore to
*/
static public function restore($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true, $lang = 'en')
static public function restore($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true, $lang = 'en', $port = '')
{
G::LoadThirdParty('pear/Archive', 'Tar');
$backup = new Archive_Tar($filename);
@@ -1621,6 +1623,9 @@ class workspaceTools
CLI::logging(CLI::error("Could not get the shared folder permissions, not changing workspace permissions") . "\n");
}
list ($dbHost, $dbUser, $dbPass) = @explode(SYSTEM_HASH, G::decrypt(HASH_INSTALLATION, SYSTEM_HASH));
if($port != ''){
$dbHost = $dbHost.$port;
}
$aParameters = array('dbHost'=>$dbHost,'dbUser'=>$dbUser,'dbPass'=>$dbPass);
CLI::logging("> Connecting to system database in '$dbHost'\n");
$link = mysql_connect($dbHost, $dbUser, $dbPass);
@@ -2079,6 +2084,7 @@ class workspaceTools
$data = $row;
$data["DEL_INDEX"] = $row["APP_DEL_INDEX"];
$listPaused = new ListPaused();
$listPaused ->remove($row["APP_UID"],$row["APP_DEL_INDEX"],$data);
$listPaused->setDeleted(false);
$listPaused->create($data);
}

View File

@@ -373,11 +373,11 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText
* @param eter boolean $bSystemVars
* @return array
*/
function getDynaformsVars ($sProcessUID, $bSystemVars = true, $bIncMulSelFields = 0)
function getDynaformsVars ($sProcessUID, $typeVars = 'all', $bIncMulSelFields = 0)
{
$aFields = array ();
$aFieldsNames = array ();
if ($bSystemVars) {
if ($typeVars == 'system' || $typeVars == 'all') {
$aAux = G::getSystemConstants();
foreach ($aAux as $sName => $sValue) {
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
@@ -401,21 +401,54 @@ function getDynaformsVars ($sProcessUID, $bSystemVars = true, $bIncMulSelFields
$oDataset->next();
$row = $oDataset->getRow();
if (isset($row["PRJ_UID"])) {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_UID);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE);
$oCriteria->add(ProcessVariablesPeer::PRJ_UID, $sProcessUID);
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$row = $oDataset->getRow();
array_push($aFields, array(
"sName" => $row["VAR_NAME"],
"sType" => $row["VAR_FIELD_TYPE"],
"sLabel" => $row["VAR_NAME"] . " [" . $row["VAR_FIELD_TYPE"] . "]"
));
if($typeVars == 'process' || $typeVars == 'all') {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_UID);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE);
$oCriteria->add(ProcessVariablesPeer::PRJ_UID, $sProcessUID);
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$row = $oDataset->getRow();
array_push($aFields, array(
"sName" => $row["VAR_NAME"],
"sType" => $row["VAR_FIELD_TYPE"],
"sLabel" => $row["VAR_FIELD_TYPE"]
));
}
}
if($typeVars == 'grid' || $typeVars == 'all') {
$oC = new Criteria( 'workflow' );
$oC->addSelectColumn( DynaformPeer::DYN_CONTENT );
$oC->add( DynaformPeer::PRO_UID, $sProcessUID );
$oC->add( DynaformPeer::DYN_TYPE, 'xmlform' );
$oData = DynaformPeer::doSelectRS( $oC );
$oData->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oData->next();
while ($aRowd = $oData->getRow()) {
$dynaform = G::json_decode($aRowd['DYN_CONTENT'],true);
if(is_array($dynaform) && sizeof($dynaform)) {
$items = $dynaform['items'][0]['items'];
foreach($items as $key => $val){
if($val[0]['type'] == 'grid'){
if(sizeof($val[0]['columns'])) {
$columns = $val[0]['columns'];
foreach($columns as $column) {
array_push($aFields, array(
"sName" => $column['name'],
"sType" => $column['type'],
"sLabel" => $column['type']
));
}
}
}
}
}
$oData->next();
}
}
} else {
require_once 'classes/model/Dynaform.php';
$oCriteria = new Criteria( 'workflow' );

View File

@@ -1,19 +1,35 @@
var setVariablePickerJS = function(){
if (document.getElementById('_Var_Form_').addEventListener) // W3C DOM
document.getElementById('_Var_Form_').addEventListener('dblclick', function(){
if (this.getAttribute('displayOption')=='event'){
e.insertFormVar(this.value.substring(2), this.value.substring(2), 'dyn' );
if(this.value.substring(0,5) == 'gridt') {
try {
updateEditorContent(this.value.substring(5));
} catch(err) {
closePluginPopup();
}
} else {
insertFormVar(document.getElementById('selectedField').value, this.value);
if (this.getAttribute('displayOption')=='event'){
e.insertFormVar(this.value.substring(2), this.value.substring(2), 'dyn' );
} else {
insertFormVar(document.getElementById('selectedField').value, this.value);
}
}
});
else if (document.getElementById('selectedField').attachEvent) { // IE DOM
var element = document.getElementById('_Var_Form_');
element.attachEvent("ondblclick", function(){
if (element.displayOption=='event'){
e.insertFormVar(element.value.substring(2), element.value.substring(2), 'dyn' );
} else {
insertFormVar(document.getElementById('selectedField').value, element.value);
if(element.value.substring(0,5) == 'gridt') {
try {
updateEditorContent(element.value.substring(5));
} catch(err) {
closePluginPopup();
}
} else {
if (element.displayOption=='event'){
e.insertFormVar(element.value.substring(2), element.value.substring(2), 'dyn' );
} else {
insertFormVar(document.getElementById('selectedField').value, element.value);
}
}
});
}
@@ -99,7 +115,12 @@ var setVariablePickerJS = function(){
});
leimnud.event.add(document.getElementById('_Var_Form_'), 'change', function(event) {
document.getElementById('selectedVariableLabel').textContent = document.getElementById('_Var_Form_').value
var selectElement = document.getElementById('_Var_Form_');
if(selectElement.value.substring(0,5) == 'gridt') {
document.getElementById('selectedVariableLabel').textContent = selectElement.options[selectElement.selectedIndex].text;
} else {
document.getElementById('selectedVariableLabel').textContent = selectElement.value
}
});
leimnud.event.add(document.getElementById('search'), 'keypress', function(e) {
@@ -130,6 +151,7 @@ var setVariablePickerJS = function(){
var list = getVariableList(document.getElementById('search').value, document.getElementById('process').value, document.getElementById('type_variables').value);
var combo = document.getElementById("_Var_Form_");
var option = document.createElement('option');
var isBpmn = document.getElementById('isBpmn').value;
for(i=(combo.length-1); i>=0; i--)
{
@@ -140,8 +162,15 @@ var setVariablePickerJS = function(){
if(list.length>0){
for(i=0; i<list.length; i++)
{
var optionValue = prefix+list[i].sName;
if(isBpmn) {
if(list[i].sLabel.toLowerCase() == 'grid') {
var gridValue = 'gridt<table border=1 cellspacing=0><tr><th>Header_1</th></tr><tbody><!--@>'+list[i].sName+'--><tr><td>column_name1</td></tr><!--@<'+list[i].sName+'--></tbody></table>';
optionValue = gridValue;
}
}
option = document.createElement("OPTION");
option.value = prefix+list[i].sName;
option.value = optionValue;
option.text = prefix+list[i].sName+' ('+list[i].sLabel+')';
combo.add(option);
}

View File

@@ -66,6 +66,20 @@ $html .= '<select name="type_variables" id="type_variables">';
$html .= '<option value="all">'.$filter->xssFilterHard(G::LoadTranslation( 'ID_TINY_ALL_VARIABLES' )).'</option>';
$html .= '<option value="system">'.$filter->xssFilterHard(G::LoadTranslation( 'ID_TINY_SYSTEM_VARIABLES' )).'</option>';
$html .= '<option value="process">'.$filter->xssFilterHard(G::LoadTranslation( 'ID_TINY_PROCESS_VARIABLES' )).'</option>';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(BpmnProjectPeer::PRJ_UID);
$oCriteria->add(BpmnProjectPeer::PRJ_UID, $_REQUEST['sProcess']);
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$row = $oDataset->getRow();
$isBpmn = false;
if (isset($row["PRJ_UID"])) {
$isBpmn = true;
$html .= '<option value="grid">'.$filter->xssFilterHard(G::LoadTranslation( 'ID_TINY_GRID_VARIABLES' )).'</option>';
}
$html .= '</select> &nbsp;&nbsp;&nbsp;&nbsp;';
$html .= '</td>';
@@ -104,7 +118,14 @@ if (isset($_REQUEST['displayOption'])){
$html .= '<select name="_Var_Form_" id="_Var_Form_" size="8" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:170;' : '') . '" '.$displayOption.'>';
foreach ($aFields as $aField) {
$html .= '<option value="' . $_REQUEST['sSymbol'] . $aField['sName'] . '">' . $_REQUEST['sSymbol'] . $aField['sName'] . ' (' . $aField['sType'] . ')</option>';
$value = $_REQUEST['sSymbol'] . $aField['sName'];
if ($isBpmn) {
if(strtolower($aField['sType']) == 'grid') {
$gridValue = 'gridt<table border=1 cellspacing=0> <tr> <th>Header_1</th> </tr> <!--@>'.$aField['sName'].'--> <tr> <td>column_name1</td> </tr><!--@<'.$aField['sName'].'--> </table>';
$value = htmlentities($gridValue);
}
}
$html .= '<option value="' . $value . '">' . $_REQUEST['sSymbol'] . $aField['sName'] . ' (' . $aField['sType'] . ')</option>';
}
$aRows[0] = Array ('fieldname' => 'char','variable' => 'char','type' => 'type','label' => 'char');
@@ -114,6 +135,13 @@ foreach ($aFields as $aField) {
}
$html .= '</select>';
if ($isBpmn) {
$valueBpmn = 1;
} else {
$valueBpmn = 0;
}
$html .= '<input type="hidden" id="isBpmn" value="'.$valueBpmn.'">';
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';

View File

@@ -806,15 +806,21 @@ try {
G::LoadClass('xmlfield_InputPM');
$proUid = isset($_REQUEST['process']) ? $_REQUEST['process'] : '';
$queryText = isset($_REQUEST['queryText']) ? $_REQUEST['queryText'] : '';
if ($_REQUEST['type'] == 'system') {
$isSystem = true;
} else {
$isSystem = false;
switch($_REQUEST['type']) {
case 'system';
$typeVars = $_REQUEST['type'];
break;
case 'process';
$typeVars = $_REQUEST['type'];
break;
case 'grid';
$typeVars = $_REQUEST['type'];
break;
}
if ($_REQUEST['type'] == 'all') {
$aFields = getDynaformsVars($proUid);
} else {
$aFields = getDynaformsVars($proUid, $isSystem, isset($_REQUEST['bIncMulSelFields']) ? $_REQUEST['bIncMulSelFields'] : 1);
$aFields = getDynaformsVars($proUid, $typeVars, isset($_REQUEST['bIncMulSelFields']) ? $_REQUEST['bIncMulSelFields'] : 1);
}
$aVariables = array();

View File

@@ -32,10 +32,11 @@ try {
}
if (\BpmnProject::exists($_GET["pro_uid"])) {
$exporter = new ProcessMaker\Exporter\XmlExporter($_GET["pro_uid"]);
$getProjectName = $exporter->truncateName($exporter->getProjectName(),false);
$version = ProcessMaker\Util\Common::getLastVersion($outputDir . $exporter->getProjectName() . "-*.pmx") + 1;
$outputFilename = sprintf("%s-%s.%s", str_replace(" ", "_", $exporter->getProjectName()), $version, "pmx");
$exporter->saveExport($outputDir . $outputFilename);
$version = ProcessMaker\Util\Common::getLastVersion($outputDir . $getProjectName . "-*.pmx") + 1;
$outputFilename = sprintf("%s-%s.%s", str_replace(" ","_",$getProjectName), $version, "pmx");
$outputFilename = $exporter->saveExport($outputDir . $outputFilename);
} else {
$oProcess = new Processes();
$proFields = $oProcess->serializeProcess($_GET["pro_uid"]);
@@ -47,15 +48,15 @@ try {
$response->file_hash = base64_encode($outputFilename);
$response->success = true;
/* Render page */
/* Render page */
if (isset( $_REQUEST["processMap"] ) && $_REQUEST["processMap"] == 1) {
$link = parse_url($result['FILENAME_LINK']);
$result['FILENAME_LINK'] = $link['path'] . '?file_hash=' . $response->file_hash;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( "xmlform", "xmlform", "processes/processes_Export", "", $result );
G::RenderPage( "publish", "raw" );
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( "xmlform", "xmlform", "processes/processes_Export", "", $result );
G::RenderPage( "publish", "raw" );
} else{
echo json_encode($response);
}

View File

@@ -15,7 +15,7 @@
}
#loading{
position:absolute;
left:40%;
left:45%;
top:37%;
padding:2px;
z-index:20001;

View File

@@ -246,31 +246,31 @@ class DataBaseConnection
// STEP 3 : Trying to connect to host
$respTest['2'] = array();
$respTest['2']['test'] = 'Trying to connect to host ' . $dataCon['DBS_SERVER'] . (($dataCon['DBS_PORT'] != '') ? ':'.$dataCon['DBS_PORT'] : '');
$respTest['2']['test'] = 'Connecting to host ' . $dataCon['DBS_SERVER'] . (($dataCon['DBS_PORT'] != '') ? ':'.$dataCon['DBS_PORT'] : '');
$Server->loginDbServer($dataCon['DBS_USERNAME'], $dataCon['DBS_PASSWORD']);
$Server->setDataBase($dataCon['DBS_DATABASE_NAME'], $dataCon['DBS_PORT']);
if ($Server->errno == 0) {
$response = $Server->tryConnectServer($dataCon['DBS_TYPE']);
if ($response->status != 'SUCCESS') {
if ($returnArray) {
$respTest['2']['error'] = "Error Testing Connection: Trying to connect to host FAILED : " . $Server->error;
$respTest['2']['error'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Trying to connect to host FAILED : " . $Server->error;
$resp['message'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
return $resp;
}
}
} else {
if ($returnArray) {
$respTest['2']['error'] = "Error Testing Connection: Trying to connect to host FAILED : " . $Server->error;
$respTest['2']['error'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Trying to connect to host FAILED : " . $Server->error;
$resp['message'] = "Error Testing Connection: Connecting to host FAILED : " . $Server->error;
return $resp;
}
}
// STEP 4 : Trying to open database
$respTest['3'] = array();
$respTest['3']['test'] = 'Trying to open database [' . $dataCon['DBS_DATABASE_NAME'] . ']';
$respTest['3']['test'] = 'Opening database [' . $dataCon['DBS_DATABASE_NAME'] . ']';
$Server->loginDbServer($dataCon['DBS_USERNAME'], $dataCon['DBS_PASSWORD']);
$Server->setDataBase($dataCon['DBS_DATABASE_NAME'], $dataCon['DBS_PORT']);
if ($Server->errno == 0) {
@@ -279,25 +279,25 @@ class DataBaseConnection
$response = $Server->tryOpenDataBase($dataCon['DBS_TYPE']);
if ($response->status != 'SUCCESS') {
if ($returnArray) {
$respTest['3']['error'] = "Error Testing Connection: Trying to open database FAILED : " . $Server->error;
$respTest['3']['error'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Trying to open database FAILED : " . $Server->error;
$resp['message'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
return $resp;
}
}
} else {
if ($returnArray) {
$respTest['3']['error'] = "Error Testing Connection: Trying to open database FAILED : " . $Server->error;
$respTest['3']['error'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Trying to open database FAILED : " . $Server->error;
$resp['message'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
return $resp;
}
}
} else {
if ($returnArray) {
$respTest['3']['error'] = "Error Testing Connection: Trying to open database FAILED : " . $Server->error;
$respTest['3']['error'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
} else {
$resp['message'] = "Error Testing Connection: Trying to open database FAILED : " . $Server->error;
$resp['message'] = "Error Testing Connection: Opening database FAILED : " . $Server->error;
return $resp;
}
}
@@ -374,4 +374,3 @@ class DataBaseConnection
return $dbs_uid;
}
}

View File

@@ -127,9 +127,13 @@ class XmlExporter extends Exporter
if (! is_dir($parentDir)) {
Util\Common::mk_dir($parentDir, 0775);
}
$outputFile = $this->Truncatename($outputFile);
file_put_contents($outputFile, $this->export());
chmod($outputFile, 0755);
return basename($outputFile);
}
/**
@@ -149,4 +153,36 @@ class XmlExporter extends Exporter
return $this->dom->createCDATASection($value);
}
}
public function truncateName($outputFile,$dirName = true)
{
$limit = 200;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$limit = 150;
}
if($dirName) {
if (strlen(basename($outputFile)) >= $limit) {
$lastPos = strrpos(basename($outputFile),'.');
$fileName = substr(basename($outputFile),0,$lastPos);
$newFileName = str_replace(".","_",$fileName);
$newFileName = str_replace(" ","_",$fileName);
$excess = strlen($newFileName) - $limit;
$newFileName = substr($newFileName,0,strlen($newFileName)-$excess);
$newOutputFile = str_replace($fileName,$newFileName,$outputFile);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$newOutputFile = str_replace("/", DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, $newOutputFile);
}
$outputFile = $newOutputFile;
}
} else {
$outputFile = str_replace(".","_",$outputFile);
$outputFile = str_replace(" ","_",$outputFile);
if (strlen($outputFile) >= $limit) {
$excess = strlen($outputFile) - $limit;
$newFileName = substr($outputFile,0,strlen($outputFile)-$excess);
$outputFile = $newFileName;
}
}
return $outputFile;
}
}

View File

@@ -108,13 +108,14 @@ class Project extends Api
public function export($prj_uid)
{
$exporter = new \ProcessMaker\Exporter\XmlExporter($prj_uid);
$getProjectName = $exporter->truncateName($exporter->getProjectName(),false);
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$version = \ProcessMaker\Util\Common::getLastVersion($outputDir . $exporter->getProjectName() . "-*.pmx") + 1;
$outputFilename = $outputDir . sprintf("%s-%s.%s", str_replace(" ", "_", $exporter->getProjectName()), $version, "pmx");
$version = \ProcessMaker\Util\Common::getLastVersion($outputDir . $getProjectName . "-*.pmx") + 1;
$outputFilename = $outputDir . sprintf("%s-%s.%s", str_replace(" ", "_", $getProjectName), $version, "pmx");
$exporter->setMetadata("export_version", $version);
$exporter->saveExport($outputFilename);
$outputFilename = $outputDir . $exporter->saveExport($outputFilename);
$httpStream = new \ProcessMaker\Util\IO\HttpStream();
$fileExtension = pathinfo($outputFilename, PATHINFO_EXTENSION);

View File

@@ -33,13 +33,15 @@ function openCaseNotesWindow(appUid1, delIndex, modalSw, appTitle, proUid, taskU
var startRecord=0;
var loadSize=10;
startRecord=startRecord+loadSize;
storeNotes = new Ext.data.JsonStore({
url: "../appProxy/getNotesList?appUid=" + appUid + "&delIndex=" + delIndex + "&pro=" + proUid + "&tas=" + taskUid,
root: 'notes',
totalProperty: 'totalCount',
fields: ['USR_USERNAME','USR_FIRSTNAME','USR_LASTNAME','USR_FULL_NAME','NOTE_DATE','NOTE_CONTENT', 'USR_UID', 'user'],
baseParams:{
start:startRecord,
start:0,
limit:startRecord+loadSize
},
listeners:{

View File

@@ -101,13 +101,14 @@
</nav>
</section>
<div class="bpmn_shapes">
</div>
<!--</div>-->
<div id="p-center-layout"/>
<!--BODY-->
<div class="ui-layout-center tab-content" id="div-layout-canvas">
</div>
<div class="bpmn_shapes">
</div>
<section class="content" id="idContent">
<div class="content_controls">

View File

@@ -558,7 +558,14 @@ function newProcess(params)
width: 260,
maskRe: /^(?!^(PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d|\...*)(\..+)?$)[^\x00-\x1f\\?*\";|/]+$/i,
allowBlank: false,
vtype: "textWithoutTags"
vtype: "textWithoutTags",
listeners: {
'focus' : function(value){
document.getElementById("PRO_TITLE").onpaste = function() {
return false;
};
}
}
}, {
id: 'PRO_DESCRIPTION',
fieldLabel: _('ID_DESCRIPTION'),

View File

@@ -98,7 +98,7 @@ function showGettingStarted() {
panel.options = {
size: {w:620,h:500},
position: {x:50,y:50,center:true},
control: {close:true,resize:false},fx:{modal:true},
control: {close:true,resize:false, drag: false},fx:{modal:true},
statusBar: false,
fx: {shadow:true,modal:true}
};