Merge branch 'master' of github.com:colosa/processmaker

This commit is contained in:
Erik Amaru Ortiz
2013-11-13 09:29:47 -04:00
21 changed files with 251 additions and 166 deletions

View File

@@ -37,6 +37,7 @@ class headPublisher
public static $instance = null;
public $scriptFiles = array();
public $cssFiles = array();
public $leimnudLoad = array();
/* extJsSkin init coreLoad flag */
@@ -134,6 +135,11 @@ class headPublisher
}
}
public function addCssFile($url)
{
$this->cssFiles[$url] = $url;
}
/**
* Function addInstanceModule
*
@@ -214,6 +220,10 @@ class headPublisher
$head = '';
$head .= '<TITLE>' . $this->title . "</TITLE>\n";
foreach ($this->cssFiles as $file) {
$head = $head . " <link rel=\"stylesheet\" href=\"" . G::browserCacheFilesUrl($file) . "\">\n";
}
$head = $head . "
<script type=\"text/javascript\">
var BROWSER_CACHE_FILES_UID = \"" . G::browserCacheFilesGetUid() . "\";

View File

@@ -446,7 +446,11 @@ class AppSolr
$delegationIndexes[] = "APP_UNASSIGNED_USER_GROUP_DEL_INDEX_" . trim ($group ['GRP_UID']) . '_txt';
}
}
// Paused, add condition
if ($userUid != null && $action == 'paused') {
$solrSearchText .= "APP_PAUSED_USERS:" . $userUid . ' AND ';
$delegationIndexes[] = "APP_PAUSED_USER_DEL_INDEX_" . trim ($userUid) . '_txt';
}
//search action
if ($action == 'search'){
if($dateFrom != "" || $dateTo != "") {
@@ -515,12 +519,12 @@ class AppSolr
'resultFormat' => 'json'
);
$solrRequestData = Entity_SolrRequestData::createForRequestPagination ($data);
// use search index to return list of cases
$searchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
// execute query
$solrQueryResult = $searchIndex->getDataTablePaginatedList ($solrRequestData);
if($this->debug)
{
$this->afterSolrQueryTime = microtime (true);
@@ -787,6 +791,9 @@ class AppSolr
$data = $this->getAppGridData ($userUid, 0, 0, 'unassigned', null, null, null, null,
null, null, null, null, null, null, null, true);
$casesCount ['selfservice'] = $data ['totalCount'];
$data = $this->getAppGridData ($userUid, 0, 0, 'paused', null, null, null, null,
null, null, null, null, null, null, null, true);
$casesCount ['paused'] = $data ['totalCount'];
return $casesCount;
}
@@ -1309,7 +1316,6 @@ class AppSolr
*/
public function updateApplicationSearchIndex($aaAPPUIDs, $saveDBRecord = false)
{
if (empty ($aaAPPUIDs))
return;
@@ -1642,6 +1648,7 @@ class AppSolr
$participatedUsersCompletedByUser = $result [11];
$unassignedUsers = $result [12];
$unassignedGroups = $result [13];
$pausedtUser = $result [14];
try {
@@ -1649,7 +1656,7 @@ class AppSolr
$xmlCurrentDoc = $this->buildSearchIndexDocumentPMOS2 ($documentInformation, $dynaformFieldTypes,
$lastUpdateDate, $maxPriority, $delLastIndex, $assignedUsers, $assignedUsersRead, $assignedUsersUnread,
$draftUser, $participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser,
$unassignedUsers, $unassignedGroups);
$unassignedUsers, $unassignedGroups,$pausedtUser);
//concat doc to the list of docs
$xmlDoc .= $xmlCurrentDoc;
@@ -1749,7 +1756,7 @@ class AppSolr
public function buildSearchIndexDocumentPMOS2($documentData, $dynaformFieldTypes, $lastUpdateDate,
$maxPriority, $delLastIndex, $assignedUsers, $assignedUsersRead, $assignedUsersUnread, $draftUser,
$participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser,
$unassignedUsers, $unassignedGroups)
$unassignedUsers, $unassignedGroups,$pausedtUser)
{
// build xml document
@@ -1964,6 +1971,19 @@ class AppSolr
$writer->endElement ();
}
}
if (! empty ($pausedtUser)) {
foreach ($pausedtUser as $paused) {
$writer->startElement ("field");
$writer->writeAttribute ('name', 'APP_PAUSED_USERS');
$writer->text ($paused ['USR_UID']);
$writer->endElement ();
$writer->startElement ("field");
$writer->writeAttribute ('name', 'APP_PAUSED_USER_DEL_INDEX_' . trim ($paused ['USR_UID']) . '_txt');
$writer->text ($paused ['DEL_INDEX']);
$writer->endElement ();
}
}
// get the serialized fields
if (! empty ($documentData ['APP_DATA']) && $documentData ['APP_DATA'] != "N;" ) {
@@ -2184,7 +2204,8 @@ class AppSolr
$indexes = $this->aaSearchRecords ($allAppDbData, array (
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_FINISH_DATE' => 'NULL',
'APP_STATUS' => 'TO_DO' //, 'APP_THREAD_STATUS' => 'OPEN'
'APP_STATUS' => 'TO_DO', //, 'APP_THREAD_STATUS' => 'OPEN'
'APP_TYPE' => ''
));
foreach ($indexes as $index) {
$assignedUsers [] = array (
@@ -2263,6 +2284,19 @@ class AppSolr
'DEL_INDEX' => $allAppDbData [$index] ['DEL_INDEX']
);
}
$pausedUsers = array ();
$indexes = $this->aaSearchRecords ($allAppDbData, array (
'APP_TYPE' => 'PAUSE'
));
foreach ($indexes as $index) {
if ($allAppDbData [$index] ['APP_DISABLE_ACTION_USER'] == null || $allAppDbData [$index] ['APP_DISABLE_ACTION_USER'] == 0) {
$pausedUsers [] = array (
'USR_UID' => $allAppDbData [$index] ['USR_UID'],
'DEL_INDEX' => $allAppDbData [$index] ['DEL_INDEX']
);
}
}
// search information of unassigned users
// the unassigned users are the self service users and groups.
// the self service users are defined in the TASKs of the PROCESS.
@@ -2369,7 +2403,8 @@ class AppSolr
$participatedUsersStartedByUser,
$participatedUsersCompletedByUser,
$unassignedUsers,
$unassignedGroups
$unassignedGroups,
$pausedUsers
);
return $result;
@@ -2649,7 +2684,6 @@ class AppSolr
*/
public function getListApplicationUpdateDelegationData($aaAppUIDs)
{
$allAppDbData = array ();
$c = new Criteria ();
@@ -2690,12 +2724,17 @@ class AppSolr
$c->addSelectColumn ('at.APP_THREAD_PARENT');
$c->addSelectColumn ('at.APP_THREAD_STATUS');
$c->addSelectColumn ('ade.APP_DELAY_UID');
$c->addSelectColumn ('ade.APP_TYPE');
$c->addSelectColumn ('ade.APP_DISABLE_ACTION_USER');
$c->addAsColumn("PRO_CATEGORY_UID", "pro.PRO_CATEGORY");
$c->addAlias ('capp', 'CONTENT');
$c->addAlias ('cpro', 'CONTENT');
$c->addAlias ('ad', 'APP_DELEGATION');
$c->addAlias ('at', 'APP_THREAD');
$c->addAlias ('ade', 'APP_DELAY');
$c->addAlias ("pro", ProcessPeer::TABLE_NAME);
$aConditions = array ();
@@ -2741,6 +2780,30 @@ class AppSolr
);
$c->addJoinMC ($aConditions, Criteria::JOIN);
$aConditions = array ();
$aConditions [] = array (
'ad.APP_UID',
'ade.APP_UID'
);
$aConditions [] = array (
'ad.DEL_INDEX',
'ade.APP_DEL_INDEX'
);
//$aConditions [] = array (
// 'ade.APP_DISABLE_ACTION_USER',
// DBAdapter::getStringDelimiter () . 'null' . DBAdapter::getStringDelimiter ()
//);
$aConditions [] = array (
'ade.APP_DISABLE_ACTION_USER',
DBAdapter::getStringDelimiter () . '0' . DBAdapter::getStringDelimiter ()
);
$aConditions [] = array (
'ade.APP_TYPE',
DBAdapter::getStringDelimiter () . 'PAUSE' . DBAdapter::getStringDelimiter ()
);
$c->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$arrayCondition = array();
$arrayCondition[] = array(ApplicationPeer::PRO_UID, "pro.PRO_UID");
$c->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
@@ -2758,7 +2821,6 @@ class AppSolr
$rs->next ();
$row = $rs->getRow ();
}
//Propel::close();
return $allAppDbData;

View File

@@ -474,7 +474,7 @@ class workspaceTools
$RBAC->initRBAC();
$result = $RBAC->verifyPermissions();
if (count($result) > 1) {
foreach($result as $item) {
foreach ($result as $item) {
CLI::logging(" $item... \n");
}
} else {
@@ -1077,7 +1077,6 @@ class workspaceTools
. ' --default_character_set utf8'
. ' --execute="SOURCE '.$filename.'"';
shell_exec($command);
} else {
//If the safe mode of the server is actived
try {
@@ -1100,6 +1099,7 @@ class workspaceTools
$line = $previous . " " . $line;
}
$previous = null;
// If the current line doesnt end with ; then put this line together
// with the next one, thus supporting multi-line statements.
if (strrpos($line, ";") != strlen($line) - 1) {
@@ -1107,18 +1107,33 @@ class workspaceTools
continue;
}
$line = substr($line, 0, strrpos($line, ";"));
if (strrpos($line, "INSERT INTO") !== false) {
if ($insert) {
$result = mysql_query("START TRANSACTION");
$insert = false;
}
$result = mysql_query($line);
continue;
} else {
if (!$insert) {
$result = mysql_query("COMMIT");
$insert = true;
}
}
$result = mysql_query($line);
if ($result === false) {
throw new Exception("Error when running script '$filename', line $j, query '$line': " . mysql_error());
}
}
if (!$insert) {
$result = mysql_query("COMMIT");
}
} catch (Exception $e) {
CLI::logging(CLI::error("Error:" . "There are problems running script '$filename': " . $e));
}
}
}
static public function restoreLegacy($directory)
@@ -1268,10 +1283,10 @@ class workspaceTools
foreach ($metadata->directories as $dir) {
CLI::logging("+> Restoring directory '$dir'\n");
if(file_exists("$tempDirectory/$dir" . "/ee")) {
if (file_exists("$tempDirectory/$dir" . "/ee")) {
G::rm_dir("$tempDirectory/$dir" . "/ee");
}
if(file_exists("$tempDirectory/$dir" . "/plugin.singleton")) {
if (file_exists("$tempDirectory/$dir" . "/plugin.singleton")) {
G::rm_dir("$tempDirectory/$dir" . "/plugin.singleton");
}
if (!rename("$tempDirectory/$dir", $workspace->path)) {
@@ -1376,7 +1391,7 @@ class workspaceTools
//Extract
$tar = new Archive_Tar($f);
$swTar = $tar->extract(PATH_OUTTRUNK); //true on success, false on error
$swTar = $tar->extractModify(PATH_TRUNK, "processmaker"); //true on success, false on error
if ($swTar) {
$result["status"] = 1;

View File

@@ -48,6 +48,8 @@ class Process extends BaseProcess
* @var string
*/
protected $pro_title = '';
public $dir = 'ASC';
public $sort = 'PRO_TITLE';
/**
* Get the [Pro_title] column value.
@@ -387,7 +389,12 @@ class Process extends BaseProcess
}
}
usort( $processes, 'ordProcessByProTitle' );
if ($this->dir=='ASC') {
usort( $processes, array($this, "ordProcessAsc") );
} else {
usort( $processes, array($this, "ordProcessDesc") );
}
return $processes;
}
@@ -629,13 +636,6 @@ class Process extends BaseProcess
$this->tmpCriteria = clone $oCriteria;
if ($start != '') {
$oCriteria->setOffset( $start );
}
if ($limit != '' && ! isset( $category ) && ! isset( $processName )) {
$oCriteria->setLimit( $limit );
}
//execute a query to obtain numbers, how many cases there are by process
if ($counters) {
$casesCnt = $this->getCasesCountInAllProcesses();
@@ -742,7 +742,21 @@ class Process extends BaseProcess
}
usort( $aProcesses, 'ordProcessByProTitle' );
$memcache = & PMmemcached::getSingleton( SYS_SYS );
if (isset($memcache) && $memcache->enabled == 1 ) {
return $aProcesses;
}
if ($limit == '') {
$limit = count($aProcesses);
}
if ($this->dir=='ASC') {
usort( $aProcesses, array($this, "ordProcessAsc") );
} else {
usort( $aProcesses, array($this, "ordProcessDesc") );
}
$aProcesses = array_splice($aProcesses, $start, $limit);
return $aProcesses;
}
@@ -848,16 +862,41 @@ class Process extends BaseProcess
$r = $memcache->delete( $memkeyTotal );
}
}
}
function ordProcessByProTitle ($a, $b)
{
if ($a['PRO_TITLE'] > $b['PRO_TITLE']) {
public function orderMemcache($dataMemcache, $start, $limit)
{
if ($this->dir=='ASC') {
usort( $dataMemcache, array($this, "ordProcessAsc") );
} else {
usort( $dataMemcache, array($this, "ordProcessDesc") );
}
$response = new stdclass();
$response->totalCount = count($dataMemcache);
$dataMemcache = array_splice($dataMemcache, $start, $limit);
$response->dataMemcache = $dataMemcache;
return $response;
}
public function ordProcessAsc ($a, $b)
{
if ($a[$this->sort] > $b[$this->sort]) {
return 1;
} elseif ($a['PRO_TITLE'] < $b['PRO_TITLE']) {
} elseif ($a[$this->sort] < $b[$this->sort]) {
return - 1;
} else {
return 0;
}
}
public function ordProcessDesc ($a, $b)
{
if ($a[$this->sort] > $b[$this->sort]) {
return - 1;
} elseif ($a[$this->sort] < $b[$this->sort]) {
return 1;
} else {
return 0;
}
}
}

View File

@@ -1547,6 +1547,9 @@
<parameter name="Comment" value=""/>
</vendor>
</index>
<index name="indexAppUid">
<index-column name="APP_UID"/>
</index>
</table>
<table name="PROCESS_USER">
<vendor type="mysql">

View File

@@ -728,7 +728,8 @@ CREATE TABLE `APP_DELAY`
`APP_DISABLE_ACTION_DATE` DATETIME,
`APP_AUTOMATIC_DISABLED_DATE` DATETIME,
PRIMARY KEY (`APP_DELAY_UID`),
KEY `indexAppDelay`(`PRO_UID`, `APP_UID`, `APP_THREAD_INDEX`, `APP_DEL_INDEX`, `APP_NEXT_TASK`, `APP_DELEGATION_USER`, `APP_DISABLE_ACTION_USER`)
KEY `indexAppDelay`(`PRO_UID`, `APP_UID`, `APP_THREAD_INDEX`, `APP_DEL_INDEX`, `APP_NEXT_TASK`, `APP_DELEGATION_USER`, `APP_DISABLE_ACTION_USER`),
KEY `indexAppUid`(`APP_UID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='APP_DELAY';
#-----------------------------------------------------------------------------
#-- PROCESS_USER

View File

@@ -289,7 +289,7 @@ function getAllCounters ()
$aCount = $ApplicationSolrIndex->getCasesCount( $userUid );
//get paused count
$aCountMissing = $oAppCache->getAllCounters( array ('paused','completed','cancelled'), $userUid );
$aCountMissing = $oAppCache->getAllCounters( array ('completed','cancelled'), $userUid );
$aCount = array_merge( $aCount, $aCountMissing );
} else {

View File

@@ -165,9 +165,12 @@ try {
// saving the data ina pm table in case that is a new record
if (! empty( $newValues )) {
$id = key( $newValues );
if (! $oAdditionalTables->updateDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues )) {
$newValues[$id] = $aData['APP_DATA'][$id];
$idPmtable = $oForm->fields[$id]->pmconnection->pmtable != '' ? $oForm->fields[$id]->pmconnection->pmtable : $oForm->fields[$id]->owner->tree->children[0]->attributes['pmtable'];
if (!($oAdditionalTables->updateDataInTable($idPmtable, $newValues ))) {
//<--This is to know if it is a new registry on the PM Table
$oAdditionalTables->saveDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues );
$oAdditionalTables->saveDataInTable($idPmtable, $newValues );
}
}
@@ -311,6 +314,7 @@ try {
$_POST['next_step'] = $aNextStep;
$_POST['previous_step'] = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$_POST['req_val'] = $missing_req_values;
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/missRequiredFields' );
G::RenderPage( 'publish', 'blank' );

View File

@@ -26,39 +26,52 @@ require_once 'classes/model/Process.php';
$start = isset( $_POST['start'] ) ? $_POST['start'] : 0;
$limit = isset( $_POST['limit'] ) ? $_POST['limit'] : '';
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'ASC';
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
$oProcess = new Process();
$oProcess->dir = $dir;
$oProcess->sort = $sort;
//$memcache = & PMmemcached::getSingleton( SYS_SYS );
$memkey = 'no memcache';
$memcacheUsed = 'not used';
$totalCount = 0;
if (isset( $_POST['category'] ) && $_POST['category'] !== '<reset>') {
if (isset( $_POST['processName'] ))
$proData = $oProcess->getAllProcesses( $start, $limit, $_POST['category'], $_POST['processName'] );
$proData = $oProcess->getAllProcesses( $start, $limit, $_POST['category'], $_POST['processName']);
else
$proData = $oProcess->getAllProcesses( $start, $limit, $_POST['category'] );
$proData = $oProcess->getAllProcesses( $start, $limit, $_POST['category']);
} else {
if (isset( $_POST['processName'] )) {
$memkey = 'processList-' . $start . '-' . $limit . '-' . $_POST['processName'];
$memcacheUsed = 'yes';
if (($proData = $memcache->get( $memkey )) === false) {
$proData = $oProcess->getAllProcesses( $start, $limit, null, $_POST['processName'] );
$proData = $memcache->get( $memkey );
if ($proData === false) {
$proData = $oProcess->getAllProcesses( $start, $limit, null, $_POST['processName']);
$memcache->set( $memkey, $proData, PMmemcached::ONE_HOUR );
$totalCount = $oProcess->getAllProcessesCount();
$memcacheUsed = 'no';
} else {
$proData = $oProcess->orderMemcache($proData, $start, $limit);
$totalCount = $proData->totalCount;
$proData = $proData->dataMemcache;
}
} else {
$memkey = 'processList-allProcesses-' . $start . '-' . $limit;
$memkeyTotal = $memkey . '-total';
$memcacheUsed = 'yes';
if (($proData = $memcache->get( $memkey )) === false || ($totalCount = $memcache->get( $memkeyTotal )) === false) {
$proData = $oProcess->getAllProcesses( $start, $limit );
$proData = $oProcess->getAllProcesses( $start, $limit);
$totalCount = $oProcess->getAllProcessesCount();
$memcache->set( $memkey, $proData, PMmemcached::ONE_HOUR );
$memcache->set( $memkeyTotal, $totalCount, PMmemcached::ONE_HOUR );
$memcacheUsed = 'no';
} else {
$proData = $oProcess->orderMemcache($proData, $start, $limit);
$totalCount = $proData->totalCount;
$proData = $proData->dataMemcache;
}
}
}

View File

@@ -0,0 +1,8 @@
<?php
G::LoadThirdParty('geshi', 'geshi');
$geshi = new GeSHi($_POST["code"], 'php');
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2);
$geshi->set_line_style('background: #f0f0f0;');
echo $geshi->parse_code();
?>

View File

@@ -68,6 +68,8 @@ $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '', $aFields, $xmlform_action );
$oHeadPublisher =& headPublisher::getSingleton();
//$oHeadPublisher->addScriptFile('/js/codemirror/js/codemirror.js', 1);
$oHeadPublisher->addCssFile('/js/codemirror/lib/codemirror.css', 1);
$oHeadPublisher->addCssFile('/js/codemirror/addon/hint/show-hint.css', 1);
$oHeadPublisher->addScriptFile('/js/codemirror/lib/codemirror.js', 1);
$oHeadPublisher->addScriptFile("/js/codemirror/addon/edit/matchbrackets.js",1);
$oHeadPublisher->addScriptFile("/js/codemirror/mode/htmlmixed/htmlmixed.js",1);
@@ -79,5 +81,11 @@ $oHeadPublisher->addScriptFile("/js/codemirror/addon/hint/show-hint.js",1);
$oHeadPublisher->addScriptFile("/js/codemirror/addon/hint/php-hint.js",1);
$oHeadPublisher->addScriptFile("/js/codemirror/mode/php/php.js",1);
G::RenderPage( 'publish', 'raw' );
//Hack: CodeMirror needed to run Internet Explorer
$ie = (strrpos($_SERVER['HTTP_USER_AGENT'], "MSIE") === false ) ? false : true;
if ($ie) {
echo "<!DOCTYPE html>\n";
}
G::RenderPage( 'publish', 'blank' );

View File

@@ -37,6 +37,7 @@ Ext.onReady(function(){
store = new Ext.data.GroupingStore( {
//var store = new Ext.data.Store( {
remoteSort: true,
proxy : new Ext.data.HttpProxy({
url: 'processesList'
}),

View File

@@ -74,7 +74,7 @@
// Additional functions required in triggers
function triggerEditWizardSource (sUID){
popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID=' + sUID +'&BYPASS=1' , 770, 510);
window.open('@G::encryptlink(@#triggersEdit)?TRI_UID=' + sUID +'&BYPASS=1','@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_'),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+screen.width+',height='+screen.height);
}
function triggerSave(form)

View File

@@ -13,7 +13,7 @@
<triggersEdit type="hidden" defaultValue="../triggers/triggers_Edit"/>
<EDIT type="link" colWidth="" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID=' + @QTRI_UID , 930, 600); return false;"/>
<EDIT type="link" colWidth="" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="window.open('@G::encryptlink(@#triggersEdit)?TRI_UID=' + @QTRI_UID,'@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_'),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+screen.width+',height='+screen.height); return false;"/>
<CONDITION type="link" colWidth="" value="@G::LoadTranslation(ID_CONDITION)" link="#" onclick="editTriggerCondition(@QSTEP_UID, @QTRI_UID, &#039;AFTER&#039;);return false;"/>

View File

@@ -13,7 +13,7 @@
<triggersEdit type="hidden" defaultValue="../triggers/triggers_Edit"/>
<EDIT type="link" colWidth="" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID=' + @QTRI_UID , 930, 600); return false;"/>
<EDIT type="link" colWidth="" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="window.open('@G::encryptlink(@#triggersEdit)?TRI_UID=' + @QTRI_UID,'@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_'),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+screen.width+',height='+screen.height); return false;"/>
<CONDITION type="link" colWidth="" value="@G::LoadTranslation(ID_CONDITION)" link="#" onclick="editTriggerCondition(@QSTEP_UID, @QTRI_UID, &#039;BEFORE&#039;);return false;"/>

View File

@@ -46,7 +46,7 @@
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$TRI_WEBBOT}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_WEBBOT}<label class="FormRequiredTextMessage"><font color="red">*</font>{php} echo " ".(G::LoadTranslation('ID_TRIGGER_EDITOR_HINT_ADVISE_MESSAGE')); {/php}</label></td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_WEBBOT}<div id="code"></div></td>
</tr>
<tr>
<td class='FormButton' colspan="2" align="center">{$form.BTNCOPYSAVE}&nbsp;{$form.BTNCANCEL}</td>

View File

@@ -74,7 +74,7 @@
<en>Script</en>
</TRI_WEBBOT>
<BTNCOPYSAVE type="button" onclick="document.getElementById('form[TRI_WEBBOT]').value = triggerEditor.getValue(); triggerSave1(this.form);">
<BTNCOPYSAVE type="button" onclick="triggerSave1(this.form);">
<en>Copy/Import and Save</en>
</BTNCOPYSAVE>
@@ -84,25 +84,6 @@
<JS type="javascript">
<![CDATA[
/*var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
height: "200px",
width: "90%",
parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
"../contrib/php/js/tokenizephp.js", "../contrib/php/js/parsephp.js",
"../contrib/php/js/parsephphtmlmixed.js"],
stylesheet: ["css/xmlcolors.css", "css/jscolors.css", "css/csscolors.css", "css/phpcolors.css" ],
path: "js/", lineNumbers: true, continuousScanning: 500, readOnly:true, parserConfig: { phpOnly:true} });
*/
var triggerEditor = CodeMirror.fromTextArea(document.getElementById("form[TRI_WEBBOT]"), {
lineNumbers: true,
matchBrackets: true,
mode: "application/x-httpd-php",
PMEnabled: true,
indentUnit: 2,
indentWithTabs: false,
readOnly: true
});
triggerEditor.setSize(400,200);
function cancel()
{
@@ -114,8 +95,17 @@
var triUid = getField("TRIGGER_UID_AUX").value;
if (triUid != triUidPrev) {
triggerEditor.setValue(document.getElementById("form[TRI_WEBBOT]").value);
triUidPrev = triUid;
var oRPC = new leimnud.module.rpc.xmlhttp({
url : 'processes_TriggersFormatCode',
args : 'code='+document.getElementById("form[TRI_WEBBOT]").value
});
oRPC.callback = function(rpc) {
document.getElementById("form[TRI_WEBBOT]").style.display="none";
document.getElementById("code").innerHTML = rpc.xmlhttp.responseText;
};
oRPC.make();
} else {
setTimeout("triggerCheckWebbotTimer()", 100);
}
@@ -131,7 +121,6 @@
function ()
{
txtTgrTitle.value = "";
triggerEditor.setValue("");
triUidPrev= "";
}
);
@@ -146,7 +135,6 @@
setTimeout("triggerCheckWebbotTimer()", 100);
} else {
txtTgrTitle.value = "";
triggerEditor.setValue("");
triUidPrev= "";
}
}

View File

@@ -31,11 +31,6 @@
<td class='FormLabel' width="{$form_labelWidth}">{$TRI_DESCRIPTION}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.TRI_DESCRIPTION} </td> //-->
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_DESCRIPTION}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$TRI_WEBBOT}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.TRI_WEBBOT} </td> //-->
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.TRI_WEBBOT}<label class="FormRequiredTextMessage"><font color="red">*</font>{php} echo " ".(G::LoadTranslation('ID_TRIGGER_EDITOR_HINT_ADVISE_MESSAGE'));{/php}</label></td>
</tr>
<tr>
<td class='FormButton' colspan="2" align="center">{$form.SAVE}&nbsp;{$form.BTN_CANCEL}</td>

View File

@@ -19,9 +19,9 @@
<en>Description</en>
</TRI_DESCRIPTION>
<TRI_WEBBOT type="textareapm" class="formLabel" cols="55" rows="13" width="100%" height="380px" showVars="1" process="@#PRO_UID">
<TRI_WEBBOT type="textareapm" class="formLabel" cols="55" rows="13" width="100%" height="380px" showVars="1" process="@#PRO_UID" style="display:none">
</TRI_WEBBOT>
<SAVE type="button" onclick="document.getElementById('form[TRI_WEBBOT]').value = triggerEditor.getValue(); triggerSave1(this.form);">
<SAVE type="button" onclick="triggerSave1(this.form);">
<en>Save</en>
</SAVE>
<PARTNER_FLAG type="private"/>
@@ -31,29 +31,6 @@
<JS type="JavaScript"><![CDATA[
/*var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
height: "220px",
width: "80%",
parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
"../contrib/php/js/tokenizephp.js", "../contrib/php/js/parsephp.js",
"../contrib/php/js/parsephphtmlmixed.js"],
stylesheet: ["css/xmlcolors.css", "css/jscolors.css", "css/csscolors.css", "css/phpcolors.css" ],
path: "js/", lineNumbers: true, continuousScanning: 500, parserConfig: { phpOnly:true} });*/
CodeMirror.commands.autocomplete = function(cm) {
CodeMirror.showHint(cm, CodeMirror.phpHint);
}
var triggerEditor = CodeMirror.fromTextArea(document.getElementById("form[TRI_WEBBOT]"), {
lineNumbers: true,
matchBrackets: true,
mode: "application/x-httpd-php",
PMEnabled: true,
indentUnit: 2,
indentWithTabs: false,
extraKeys: {"Ctrl-Space": "autocomplete"}
});
triggerEditor.setSize(450,245);
getField('TRI_TITLE').form.onsubmit = function() {return false;};
var _oVarsPanel_;
@@ -90,16 +67,6 @@ var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol)
oRPC.make();
};
var insertFormVar = function(sFieldName, sValue) {
if (triggerEditor.getSelection() == "") {
triggerEditor.replaceRange(sValue, triggerEditor.getCursor());
} else {
triggerEditor.replaceSelection(sValue);
}
_oVarsPanel_.remove();
triggerEditor.focus();
};
function cancel(){
currentPopupWindow.remove();
}

View File

@@ -20,16 +20,6 @@
</SAVE>
<JS type="JavaScript"><![CDATA[
/*var triggerEditor = CodeMirror.fromTextArea('form[TRI_WEBBOT]', {
height: "380px",
width: "90%",
parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
"../contrib/php/js/tokenizephp.js", "../contrib/php/js/parsephp.js",
"../contrib/php/js/parsephphtmlmixed.js"],
stylesheet: ["css/xmlcolors.css", "css/jscolors.css", "css/csscolors.css", "css/phpcolors.css" ],
path: "js/", lineNumbers: true, continuousScanning: 500, parserConfig: { phpOnly:true} });
*/
CodeMirror.commands.autocomplete = function(cm) {
CodeMirror.showHint(cm, CodeMirror.phpHint);
}
@@ -90,7 +80,12 @@ var insertFormVar = function(sFieldName, sValue) {
};
function cancel(){
currentPopupWindow.remove();
window.close();
}
function triggerSave1(form){
window.close();
ajax_post(form.action, form, 'POST');
}
]]></JS>

View File

@@ -37,30 +37,6 @@
<JS type="javascript" replaceTags="1">
<![CDATA[
/*
document.onkeypress=function(e){
var esIE=(document.all);
var esNS=(document.layers);
tecla=(esIE) ? event.keyCode : e.which;
if(tecla==13){
return false;
}
}
*/
//Add css Codemirror
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('link');
s.setAttribute('href', '/js/codemirror/lib/codemirror.css');
s.setAttribute('type', 'text/css');
s.setAttribute('rel', 'stylesheet');
head.appendChild(s);
var s = document.createElement('link');
s.setAttribute('href', '/js/codemirror/addon/hint/show-hint.css');
s.setAttribute('type', 'text/css');
s.setAttribute('rel', 'stylesheet');
head.appendChild(s);
var windowWidth = 600;
var windowHeight = 460;
@@ -79,7 +55,7 @@
function triggerCopy()
{
popupWindow("@G::LoadTranslation(ID_TRIGGER_COPY_TITLE)", "@G::encryptlink(@#triggerCopy)?PRO_UID=@%PRO_UID" , windowWidth, windowHeight);
popupWindow("@G::LoadTranslation(ID_TRIGGER_COPY_TITLE)", "@G::encryptlink(@#triggerCopy)?PRO_UID=@%PRO_UID" , 900, 460);
}
function triggerFromLibrary() {
@@ -96,7 +72,7 @@
}
function triggerEdit(sUID) {
popupWindow('@G::LoadTranslation(ID_EDIT_TRIGGERS)', '@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID , 930, 600);
window.open('@G::encryptlink(@#triggersEdit)?TRI_UID='+ sUID,'@G::LoadTranslation(ID_EDIT_TRIGGERS)'.replace(/\s/g,'_'),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+screen.width+',height='+screen.height);
}
function triggerProperties( sUID ) {