Merge pull request #223 from marcoAntonioNina/BUG-0000

BUG 0000 Short tags
This commit is contained in:
julceslauhub
2012-07-11 16:01:23 -07:00
2 changed files with 299 additions and 265 deletions

View File

@@ -38,6 +38,7 @@ $aFields = $oApp->loadCase($_SESSION['APPLICATION']);
$aStoredVarNames = array_keys($aFields['APP_DATA']); $aStoredVarNames = array_keys($aFields['APP_DATA']);
$aVariables = Array(); $aVariables = Array();
for ($i=0; $i<count($_SESSION['TRIGGER_DEBUG']['DATA']); $i++) { for ($i=0; $i<count($_SESSION['TRIGGER_DEBUG']['DATA']); $i++) {
$aVariables[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value']; $aVariables[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
} }
@@ -47,7 +48,6 @@ ksort($aVariables);
//triggers //triggers
if (isset($_SESSION['TRIGGER_DEBUG']['info'])) { if (isset($_SESSION['TRIGGER_DEBUG']['info'])) {
$aTriggers = $_SESSION['TRIGGER_DEBUG']['info']; $aTriggers = $_SESSION['TRIGGER_DEBUG']['info'];
} else { } else {
@@ -60,7 +60,8 @@ foreach($aTriggers as $aTrigger) {
$t_time = $aTrigger['TIME']; $t_time = $aTrigger['TIME'];
if ($aTrigger['NUM_TRIGGERS'] != 0) { if ($aTrigger['NUM_TRIGGERS'] != 0) {
$triggers_onfly = $aTrigger['NUM_TRIGGERS']." trigger(s) was executed <font color='#641213'><b>".strtolower($aTrigger['TIME'])."</b></font><br/>"; $triggers_onfly = $aTrigger['NUM_TRIGGERS']." trigger(s) was executed <font color='#641213'><b>".
strtolower($aTrigger['TIME'])."</b></font><br/>";
$cnt = 0; $cnt = 0;
if (isset($aTrigger['TRIGGERS_NAMES'])) { if (isset($aTrigger['TRIGGERS_NAMES'])) {
@@ -85,13 +86,14 @@ $DEBUG_POST = array_unique($_SESSION['TRIGGER_DEBUG']['ERRORS']);
///// /////
function Only1br($string) { function Only1br($string)
{
return preg_replace("/(\r\n)+|(\n|\r)+/", "<br />", $string); return preg_replace("/(\r\n)+|(\n|\r)+/", "<br />", $string);
} }
?> ?>
<style>
<style>
table.pmdebugger{ table.pmdebugger{
border: 1px solid #777; border: 1px solid #777;
padding: 0; padding: 0;
@@ -121,10 +123,12 @@ function Only1br($string) {
padding: 3px; padding: 3px;
overflow: auto; overflow: auto;
} }
#debugger_triggers{ #debugger_triggers{
padding: 3px; padding: 3px;
overflow: auto; overflow: auto;
} }
#debugger_errors{ #debugger_errors{
padding: 3px; padding: 3px;
overflow: auto; overflow: auto;
@@ -137,6 +141,7 @@ function Only1br($string) {
font-family: monospace; font-family: monospace;
} }
</style> </style>
<script> <script>
function toggle(id){ function toggle(id){
var o = document.getElementById(id); var o = document.getElementById(id);
@@ -161,28 +166,36 @@ function Only1br($string) {
<table width='100%' cellspacing='0' cellpadding='0' border='1' style='border:0px;'> <table width='100%' cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
<tr> <tr>
<td width='410px' class='treeNode' style='border:0px;background-color:transparent;'> <td width='410px' class='treeNode' style='border:0px;background-color:transparent;'>
<font color='#0B58B6'><?php= $triggers_onfly?></font><br/> <font color='#0B58B6'><?php echo $triggers_onfly; ?></font><br/>
<?php if (sizeof($triggers_name) > 0) {?> <?php if (sizeof($triggers_name) > 0) {?>
<table class="pmdebugger" width="100%"> <table class="pmdebugger" width="100%">
<tr> <tr>
<td width="5" class="pmdebuggerHeader">#</td><td class="pmdebuggerHeader">Name</td><td class="pmdebuggerHeader">&nbsp;</td> <td width="5" class="pmdebuggerHeader">#</td>
<td class="pmdebuggerHeader">Name</td>
<td class="pmdebuggerHeader">&nbsp;</td>
</tr> </tr>
<?php foreach($triggers_name as $k=>$trigger) {?> <?php
foreach ($triggers_name as $k => $trigger) {?>
<tr> <tr>
<td>&nbsp;<?php =($k+1)?>&nbsp;</td> <td>&nbsp;<?php echo ($k+1); ?>&nbsp;</td>
<td> <td>
&nbsp;<?php= $trigger?> &nbsp;<?php echo $trigger; ?>
<div id='trigger_<?php= $k?>' class='ui-accordion-header ui-helper-reset ui-state-active ui-corner-all data_view'><?php=$triggers_code[$k]?></div> <div id='trigger_<?php echo $k; ?>'
class='ui-accordion-header ui-helper-reset ui-state-active ui-corner-all data_view'>
<?php echo $triggers_code[$k]; ?>
</div>
</td> </td>
<td valign="top" width="5"> <td valign="top" width="5">
<a href='#' onclick="toggle('trigger_<?php=$k?>'); return false;"> <a href='#' onclick="toggle('trigger_<?php echo $k; ?>'); return false;">
<img id='img_trigger_<?php=$k?>' src='/images/pin-up-on.gif' border='0'> <img id='img_trigger_<?php echo $k; ?>' src='/images/pin-up-on.gif' border='0'>
</a> </a>
</td> </td>
</tr> </tr>
<?php } ?> <?php
} ?>
</table> </table>
<?php } ?> <?php
} ?>
</td> </td>
</tr> </tr>
</table> </table>
@@ -195,57 +208,75 @@ function Only1br($string) {
<tr> <tr>
<td class="pmdebuggerHeader">Name</td><td class="pmdebuggerHeader">Value</td> <td class="pmdebuggerHeader">Name</td><td class="pmdebuggerHeader">Value</td>
</tr> </tr>
<?php foreach($aVariables as $sName=>$aVariable) {?> <?php
foreach ($aVariables as $sName => $aVariable) {?>
<tr> <tr>
<?php if( is_array($aVariable) ) {?> <?php
<td valign="top"><font color="blue">&nbsp;<?=$sName?></font></td> if (is_array($aVariable)) {?>
<?php } else {?> <td valign="top"><font color="blue">&nbsp;<?php
<td>&nbsp;<?php =$sName?></td> echo $sName; ?></font></td>
<?php }?> <?php
} else {?>
<td>&nbsp;<?php echo $sName; ?></td>
<?php
}?>
<td><?php echo expandVarView($aVariable, $sName)?></td> <td><?php echo expandVarView($aVariable, $sName)?></td>
</tr> </tr>
<?php }?> <?php
}?>
</table> </table>
</div> </div>
<!----> <!---->
<?php if( count($DEBUG_POST) > 0 ) {?>
<?php
if (count($DEBUG_POST) > 0) {?>
<div class="ui-widget-header ui-corner-all" width="50%" align="center">Errors</div> <div class="ui-widget-header ui-corner-all" width="50%" align="center">Errors</div>
<div id="debugger_errors" class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-all" align="left"> <div id="debugger_errors" class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-all" align="left">
<?php for($i=0; $i<count($DEBUG_POST); $i++) { <?php
for ($i=0; $i<count($DEBUG_POST); $i++) {
if (isset($DEBUG_POST[$i]['ERROR']) and $DEBUG_POST[$i]['ERROR'] != '') {?> if (isset($DEBUG_POST[$i]['ERROR']) and $DEBUG_POST[$i]['ERROR'] != '') {?>
<span class='treeNode'> <span class='treeNode'>
<font color='red'>Error </font> <font color='red'>Error </font>
<font color='#0B58B6'><?php=str_replace('<br />', '',$DEBUG_POST[$i]['ERROR'])?></font> <font color='#0B58B6'><?php echo str_replace('<br />', '',$DEBUG_POST[$i]['ERROR']);?></font>
</span><br/> </span><br/>
<?php} <?php
}
} }
for ($i=0; $i<count($DEBUG_POST); $i++) { ?> for ($i=0; $i<count($DEBUG_POST); $i++) { ?>
<?php if(isset($DEBUG_POST[$i]['FATAL']) and $DEBUG_POST[$i]['FATAL'] != '') { ?> <?php
if (isset($DEBUG_POST[$i]['FATAL']) and $DEBUG_POST[$i]['FATAL'] != '') {?>
<span class='treeNode'> <span class='treeNode'>
<font color='red'>Fatal error </font> <font color='red'>Fatal error </font>
<font color='#0B58B6'> <?php=str_replace('<br />', '',$DEBUG_POST[$i]['FATAL'])?></font> <font color='#0B58B6'> <?php echo str_replace('<br />', '',$DEBUG_POST[$i]['FATAL']); ?></font>
</span><br/> </span><br/>
<?php } <?php
}
} }
} else { ?> } else { ?>
<div class="ui-widget-header ui-corner-all" width="50%" align="center">No errors reported</div> <div class="ui-widget-header ui-corner-all" width="50%" align="center">No errors reported</div>
<?php}?> <?php
}?>
</div> </div>
<!----> <!---->
<?php if (isset($_POST['NextStep'])) {?> <?php if (isset($_POST['NextStep'])) {?>
<input type="button" value="Continue" class="module_app_button___gray" onclick="javascript:location.href='<?php= $_POST['NextStep']?>'"> <input type="button" value="Continue" class="module_app_button___gray" onclick="javascript:location.href='
<?php}?> <?php echo $_POST['NextStep']; ?>'">
<?php
}?>
<?php <?php
function expandVarView($a, $name) { function expandVarView($a, $name)
{
if (is_array($a)) { if (is_array($a)) {
echo "<a href='#' onclick=\"toggle('data_view_{$name}'); return false;\"><img id='img_data_view_{$name}' src='/images/pin-up-on.gif' border='0'></a><div id='data_view_{$name}' class='data_view'><table class='pmdebugger' width='100%'>"; echo "<a href='#' onclick=\"toggle('data_view_{$name}'); return false;\">
<img id='img_data_view_{$name}' src='/images/pin-up-on.gif' border='0'></a>
<div id='data_view_{$name}' class='data_view'><table class='pmdebugger' width='100%'>";
foreach ($a as $k => $v) { foreach ($a as $k => $v) {
echo "<tr><td valign='top'>&nbsp;$k</td><td>"; echo "<tr><td valign='top'>&nbsp;$k</td><td>";
expandVarView($v, "{$name}_{$k}"); expandVarView($v, "{$name}_{$k}");
@@ -255,7 +286,5 @@ function expandVarView($a, $name) {
} else { } else {
echo ($a=='')? '&nbsp;': "&nbsp;$a"; echo ($a=='')? '&nbsp;': "&nbsp;$a";
} }
} }
?>

View File

@@ -1,4 +1,9 @@
<?php if (isset($_POST['NextStep'])) {?> <?php if (isset($_POST['NextStep'])) {?>
<div class="ui-widget-header ui-corner-all" width="100%" align="center">Processmaker - Debugger (Break Point)&nbsp;&nbsp;&nbsp;&nbsp; <input type="button" value="Continue" class="module_app_button___gray" onclick="javascript:location.href='<?=$_POST['NextStep']?>'"> <div class="ui-widget-header ui-corner-all" width="100%" align="center">
Processmaker - Debugger (Break Point)&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="Continue" class="module_app_button___gray"
onclick="javascript:location.href='<?php echo $_POST['NextStep']; ?>'">
</div> </div>
<?php }?> <?php
}