Merge pull request #813 from ralpheav/master

change to set the fix of $sizeof()
This commit is contained in:
ferOnti
2012-10-18 10:02:11 -07:00
13 changed files with 560 additions and 577 deletions

View File

@@ -506,7 +506,6 @@ class XmlForm_Field
if ($e !== '') {
$correct = false;
}
//##,###.## --> ^...$ no parece pero no, o mejor si, donde # es \d?, en general todos
// es valida cuando no encuentra un caracter que no deberia estar, puede no terminar la mascara
// pero si sobran caracteres en el value entonces no se cumple la mascara.
@@ -4246,7 +4245,6 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText
* $html .= '<input type="hidden" id="'.$idIsoDate.'" name="'.$idIsoDate.'" value="'.$valisoDate.'"/>';
* *
*/
if ($this->gridFieldType == '') {
$html .= $this->renderHint();
}

View File

@@ -12,84 +12,85 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
G::LoadClass('configuration');
G::LoadClass( 'configuration' );
$c = new Configurations();
$configPage = $c->getConfiguration('eventList', 'pageSize','',$_SESSION['USER_LOGGED']);
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$configPage = $c->getConfiguration( 'eventList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'logs';
$G_ID_MENU_SELECTED = 'logs';
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'logs';
$G_ID_MENU_SELECTED = 'logs';
$G_ID_SUB_MENU_SELECTED = 'EVENT';
//get values for the comboBoxes
$userUid = ( isset($_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '' ) ?
$_SESSION['USER_LOGGED'] : null;
$status = array(
array('', G::LoadTranslation('ID_ALL')),
array("PENDING",G::LoadTranslation('ID_OPEN')),
array("COMPLETED",G::LoadTranslation('ID_CLOSE')));
$type = array(
array('', G::LoadTranslation('ID_ALL')),
array('SEND_MESSAGE',G::LoadTranslation('ID_EVENT_MESSAGE')),
array('EXECUTE_TRIGGER',G::LoadTranslation('ID_EVENT_TIMER')),
array('EXECUTE_CONDITIONAL_TRIGGER',G::LoadTranslation('ID_EVENT_CONDITIONAL')));
$processes = getProcessArray($userUid );
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
$status = array (array ('',G::LoadTranslation( 'ID_ALL' )
),array ("PENDING",G::LoadTranslation( 'ID_OPEN' )
),array ("COMPLETED",G::LoadTranslation( 'ID_CLOSE' )
)
);
$type = array (array ('',G::LoadTranslation( 'ID_ALL' )
),array ('SEND_MESSAGE',G::LoadTranslation( 'ID_EVENT_MESSAGE' )
),array ('EXECUTE_TRIGGER',G::LoadTranslation( 'ID_EVENT_TIMER' )
),array ('EXECUTE_CONDITIONAL_TRIGGER',G::LoadTranslation( 'ID_EVENT_CONDITIONAL' )
)
);
$processes = getProcessArray( $userUid );
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('events/eventList', false); //adding a javascript file .js
$oHeadPublisher->addContent('events/eventList'); //adding a html file .html.
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( 'events/eventList', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'events/eventList' ); //adding a html file .html.
//sending the columns to display in grid
$oHeadPublisher->assign( 'typeValues', $type );
$oHeadPublisher->assign( 'statusValues', $status );
$oHeadPublisher->assign( 'processValues', $processes);
$oHeadPublisher->assign( 'typeValues', $type );
$oHeadPublisher->assign( 'statusValues', $status );
$oHeadPublisher->assign( 'processValues', $processes );
function getProcessArray ( $userUid ) {
function getProcessArray ($userUid)
{
global $oAppCache;
require_once ( "classes/model/AppCacheView.php" );
require_once ("classes/model/AppCacheView.php");
$processes = Array();
$processes[] = array ( '', G::LoadTranslation('ID_ALL_PROCESS') );
$processes = Array ();
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' ));
$cProcess = new Criteria('workflow');
$cProcess = new Criteria( 'workflow' );
$cProcess->clearSelectColumns();
$cProcess->addSelectColumn(AppCacheViewPeer::PRO_UID);
$cProcess->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
$cProcess->setDistinct(AppCacheViewPeer::PRO_UID);
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
$cProcess->addSelectColumn( AppCacheViewPeer::PRO_UID );
$cProcess->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
$cProcess->setDistinct( AppCacheViewPeer::PRO_UID );
$oDataset = AppCacheViewPeer::doSelectRS($cProcess);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$cProcess->addAscendingOrderByColumn( AppCacheViewPeer::APP_PRO_TITLE );
$oDataset = AppCacheViewPeer::doSelectRS( $cProcess );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while($aRow = $oDataset->getRow()){
$processes[] = array ( $aRow['PRO_UID'], $aRow['APP_PRO_TITLE'] );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$processes[] = array ($aRow['PRO_UID'],$aRow['APP_PRO_TITLE']);
$oDataset->next();
}
return $processes;
}
G::RenderPage('publish', 'extJs');
G::RenderPage( 'publish', 'extJs' );

View File

@@ -6,7 +6,6 @@ require_once 'classes/model/Content.php';
switch($req){
case 'showUsers':
/*
$sql = "SELECT USR_UID, USR_EMAIL, CONCAT(USR_FIRSTNAME, ' ' , USR_LASTNAME) AS USR_FULLNAME FROM USERS WHERE USR_STATUS = 'ACTIVE' AND USR_EMAIL <> ''";
*/
@@ -29,7 +28,7 @@ switch($req){
$rs = $stmt->executeQuery();
$aRows[] = array('USR_UID'=>'char', 'USR_EMAIL'=>'char', 'USR_FULLNAME'=>'char');
while($rs->next()){
while ($rs->next()) {
$aRows[] = array('USR_UID'=>$rs->getString('USR_UID'), 'USR_EMAIL'=>$rs->getString('USR_EMAIL'), 'USR_FULLNAME'=>$rs->getString('USR_FULLNAME'));
}
//echo '<pre>'; print_r($aRows);
@@ -40,11 +39,10 @@ switch($req){
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('virtualtable');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'events/usermailList', $oCriteria);
G::RenderPage('publish', 'raw');
break;
break;
case 'showGroups':
G::LoadClass('groups');
$groups = new Groups();
@@ -56,41 +54,35 @@ switch($req){
$GROUP_TITLE = strip_tags($group->getGrpTitle());
$aRows[] = array('GRP_UID'=>$UID, 'GROUP_TITLE'=>$GROUP_TITLE);
}
global $_DBArray;
$_DBArray['virtualtable'] = $aRows;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('virtualtable');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'events/groupmailList', $oCriteria);
G::RenderPage('publish', 'raw');
break;
break;
case 'showDynavars':
G::LoadClass('xmlfield_InputPM');
$dynaformFields = getDynaformsVars($_SESSION['PROCESS'], false, false);
$fields = array(array('id' => 'char', 'dynaform' => 'char', 'name' => 'char'));
foreach ($dynaformFields as $dynaformField) {
$fields[] = array('id' => $dynaformField['sName'],
'name' => '<a href="#" style="color: black;" onclick="e.toAdd(\'' . $dynaformField['sName'] . '\', \'' . $dynaformField['sName'] . '\', \'dyn\');oPanel.remove();return false;">@#' . $dynaformField['sName'] . '</a>', 'label' => $dynaformField['sLabel']);
}
global $_DBArray;
$_DBArray['virtualtable'] = $fields;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('virtualtable');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'events/dynavarsList', $oCriteria);
G::RenderPage('publish', 'raw');
break;
break;
case 'eventList':
$start = (isset($_REQUEST['start']))? $_REQUEST['start'] : '0';
$limit = (isset($_REQUEST['limit']))? $_REQUEST['limit'] : '25';
$proUid = (isset($_REQUEST['process']))? $_REQUEST['process'] : '';
@@ -110,7 +102,7 @@ switch($req){
$result = AppEventPeer::doSelectRS($criteria);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$data = Array();
while( $result->next() ) {
while ( $result->next() ) {
$data[] = $result->getRow();
}
$totalCount = count($data);
@@ -120,8 +112,7 @@ switch($req){
if ($sort != '') {
if ($dir == 'ASC') {
$criteria->addAscendingOrderByColumn($sort);
}
else {
} else {
$criteria->addDescendingOrderByColumn($sort);
}
} else {
@@ -136,12 +127,13 @@ switch($req){
$data = Array();
$dataPro = array();
$index = 0;
while( $result->next() ) {
while ( $result->next() ) {
$data[] = $result->getRow();
}
$response = array();
$response['totalCount'] = $totalCount;
$response['data'] = $data;
die(G::json_encode($response));
break;
break;
}

View File

@@ -12,27 +12,27 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
require_once 'classes/model/AppEvent.php';
$oAppEvent = new AppEvent();
global $G_PUBLISH;
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'events/appEventsListCompleted', $oAppEvent->getAppEventsCriteria($_GET['PRO_UID'], 'COMPLETED', $_GET['EVN_TYPE']));
G::RenderPage('publish', 'raw');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'events/appEventsListCompleted', $oAppEvent->getAppEventsCriteria( $_GET['PRO_UID'], 'COMPLETED', $_GET['EVN_TYPE'] ) );
G::RenderPage( 'publish', 'raw' );

View File

@@ -12,24 +12,24 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
$evnUid = $_POST['EVN_UID'];
require_once 'classes/model/Event.php';
$oEvent = new Event();
$oEvent->remove( $evnUid );
$oEvent->remove( $evnUid );

View File

@@ -12,74 +12,68 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
G::LoadClass('tasks');
G::LoadClass('processMap');
G::LoadClass( 'tasks' );
G::LoadClass( 'processMap' );
global $_DBArray;
if (isset($_GET['EVN_UID'])) {
require_once 'classes/model/Event.php';
$oEvent = new Event();
$aFields = $oEvent->load($_GET['EVN_UID']);
}
else {
$aFields = array('PRO_UID' => $_GET['PRO_UID']);
if (isset( $_GET['EVN_UID'] )) {
require_once 'classes/model/Event.php';
$oEvent = new Event();
$aFields = $oEvent->load( $_GET['EVN_UID'] );
} else {
$aFields = array ('PRO_UID' => $_GET['PRO_UID'] );
}
if (!isset($_SESSION['PROCESS'])){
if (isset($aFields['PRO_UID'])){
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
}
if (! isset( $_SESSION['PROCESS'] )) {
if (isset( $aFields['PRO_UID'] )) {
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
}
}
$oTasks = new Tasks();
$aAux1 = $oTasks->getAllTasks($aFields['PRO_UID']);
$aTasks = array();
$aTasks[] = array('TAS_UID' => 'char',
'TAS_TITLE' => 'char');
$oTasks = new Tasks();
$aAux1 = $oTasks->getAllTasks( $aFields['PRO_UID'] );
$aTasks = array ();
$aTasks[] = array ('TAS_UID' => 'char','TAS_TITLE' => 'char');
foreach ($aAux1 as $aAux2) {
if ($aAux2['TAS_TYPE'] != 'SUBPROCESS') {
$aTasks[] = array('TAS_UID' => $aAux2['TAS_UID'], 'TAS_TITLE' => $aAux2['TAS_TITLE']);
}
if ($aAux2['TAS_TYPE'] != 'SUBPROCESS') {
$aTasks[] = array ('TAS_UID' => $aAux2['TAS_UID'],'TAS_TITLE' => $aAux2['TAS_TITLE'] );
}
}
$oProcessMap = new processMap( new DBConnection() );
$aTriggersList = $oProcessMap->getTriggers( $_SESSION['PROCESS'] );
$aTriggersFileds = Array ('TRI_UID' => 'char','TRI_TITLE' => 'char');
$oProcessMap = new processMap(new DBConnection);
$aTriggersList = $oProcessMap->getTriggers($_SESSION['PROCESS']);
$aTriggersFileds = Array('TRI_UID'=>'char', 'TRI_TITLE'=>'char');
foreach($aTriggersList as $i=>$v){
unset($aTriggersList[$i]['PRO_UID']);
unset($aTriggersList[$i]['TRI_DESCRIPTION']);
$aTriggersList[$i]['TRI_TITLE'] = (strlen($aTriggersList[$i]['TRI_TITLE'])>32)? substr($aTriggersList[$i]['TRI_TITLE'], 0, 32).'...': $aTriggersList[$i]['TRI_TITLE'];
foreach ($aTriggersList as $i => $v) {
unset( $aTriggersList[$i]['PRO_UID'] );
unset( $aTriggersList[$i]['TRI_DESCRIPTION'] );
$aTriggersList[$i]['TRI_TITLE'] = (strlen( $aTriggersList[$i]['TRI_TITLE'] ) > 32) ? substr( $aTriggersList[$i]['TRI_TITLE'], 0, 32 ) . '...' : $aTriggersList[$i]['TRI_TITLE'];
}
$aTriggersList = array_merge(Array($aTriggersFileds), $aTriggersList);
$aTriggersList = array_merge( Array ($aTriggersFileds, $aTriggersList ));
$_DBArray['tasks'] = $aTasks;
$_DBArray['TMP_TRIGGERS'] = $aTriggersList;
$_SESSION['_DBArray'] = $_DBArray;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEdit', '', $aFields, '../events/eventsSave');
G::RenderPage('publish', 'raw');
?>
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'events/eventsEdit', '', $aFields, '../events/eventsSave' );
G::RenderPage( 'publish', 'raw' );

View File

@@ -12,238 +12,224 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
global $_DBArray;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
if ( isset ($_SESSION['EVN_UID']) ) {
$evnUid = $_SESSION['EVN_UID'];
unset ( $_SESSION['EVN_UID'] );
if (isset( $_SESSION['EVN_UID'] )) {
$evnUid = $_SESSION['EVN_UID'];
unset( $_SESSION['EVN_UID'] );
} else {
$evnUid = $_GET['EVN_UID'];
}
else
$evnUid = $_GET['EVN_UID'];
require_once 'classes/model/Event.php';
require_once 'classes/model/Triggers.php';
$oEvent = new Event();
$oEvent = new Event();
$oTrigger = new Triggers();
$aFields = $oEvent->load( $evnUid );
$parameters = unserialize ( $oEvent->getEvnActionParameters() );
$parameters = unserialize( $oEvent->getEvnActionParameters() );
//g::pr($parameters); die;
$aTrigger = $oTrigger->load($aFields['TRI_UID']);
$aTrigger = $oTrigger->load( $aFields['TRI_UID'] );
$hash = md5 ( $oTrigger->getTriWebbot() );
$hash = md5( $oTrigger->getTriWebbot() );
//var_dump($hash,$parameters->hash);die;
//if the hash is different, the script was edited , so we will show the trigger editor.
if ( ( isset($parameters->hash) && $hash <> $parameters->hash ) || $aFields['EVN_ACTION'] == 'EXECUTE_TRIGGER' || $aFields['EVN_ACTION'] == 'EXECUTE_CONDITIONAL_TRIGGER' ) {
$oTriggerParams = unserialize($aTrigger['TRI_PARAM']);
// check again a hash, this time to check the trigger itself integrity
if ($oTriggerParams['hash']!=$hash){
// if has changed edit manually
G::LoadClass('xmlfield_InputPM');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'triggers/triggersNarrowEdit', '', $aTrigger, '../events/triggersSave');
G::RenderPage('publish', 'raw');
die;
} else {
// if not launch the wizard view.
$triUid = $aFields['TRI_UID'];
$_GET = $oTriggerParams['params'];
$_GET['TRI_UID'] = $triUid;
require_once(PATH_METHODS.'triggers/triggers_EditWizard.php');
die;
}
if ((isset( $parameters->hash ) && $hash != $parameters->hash) || $aFields['EVN_ACTION'] == 'EXECUTE_TRIGGER' || $aFields['EVN_ACTION'] == 'EXECUTE_CONDITIONAL_TRIGGER') {
$oTriggerParams = unserialize( $aTrigger['TRI_PARAM'] );
// check again a hash, this time to check the trigger itself integrity
if ($oTriggerParams['hash'] != $hash) {
// if has changed edit manually
G::LoadClass( 'xmlfield_InputPM' );
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'triggers/triggersNarrowEdit', '', $aTrigger, '../events/triggersSave' );
G::RenderPage( 'publish', 'raw' );
die();
} else {
// if not launch the wizard view.
$triUid = $aFields['TRI_UID'];
$_GET = $oTriggerParams['params'];
$_GET['TRI_UID'] = $triUid;
require_once (PATH_METHODS . 'triggers/triggers_EditWizard.php');
die();
}
}
$aFields['EVN_MESSAGE_SUBJECT'] = (isset($parameters->SUBJECT) ? $parameters->SUBJECT : '');
$aFields['EVN_MESSAGE_SUBJECT'] = (isset( $parameters->SUBJECT ) ? $parameters->SUBJECT : '');
if(isset($parameters->TO)){
$paramTO[] = Array('id'=>'char', 'name'=>'char');
//echo '<pre>';print_r($parameters->TO);
foreach($parameters->TO as $item){
$row = explode('|', $item);
switch($row[0]){
case 'usr':
require_once('classes/model/Users.php');
$user = new Users();
if($row[1] == '-1'){
$value = '(Current Task User)';
} else {
$rec = $user->load($row[1]);
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass('groups');
$group = new Groups();
$rec = $group->load($row[1]);
$value = strip_tags($rec->getGrpTitle());
break;
case 'ext':
$value = htmlentities($row[1]);
break;
case 'dyn':
$value = htmlentities('@#'.$row[1]);
break;
default:
echo '->'.$row[0];
}
$paramTO[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
}
if (isset( $parameters->TO )) {
$paramTO[] = Array ('id' => 'char','name' => 'char' );
//echo '<pre>';print_r($parameters->TO);
foreach ($parameters->TO as $item) {
$row = explode( '|', $item );
switch ($row[0]) {
case 'usr':
require_once ('classes/model/Users.php');
$user = new Users();
if ($row[1] == '-1') {
$value = '(Current Task User)';
} else {
$rec = $user->load( $row[1] );
$value = $rec['USR_FIRSTNAME'] . ' ' . $rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass( 'groups' );
$group = new Groups();
$rec = $group->load( $row[1] );
$value = strip_tags( $rec->getGrpTitle() );
break;
case 'ext':
$value = htmlentities( $row[1] );
break;
case 'dyn':
$value = htmlentities( '@#' . $row[1] );
break;
default:
echo '->' . $row[0];
}
$paramTO[] = Array ('id' => replaceQuotes( $item ),'name' => $value
);
}
} else {
$paramTO[] = Array('id'=>'char', 'name'=>'char');
$paramTO[] = Array('id'=>'usr|-1', 'name'=>'(Current Task User)');
$paramTO[] = Array ('id' => 'char','name' => 'char'
);
$paramTO[] = Array ('id' => 'usr|-1','name' => '(Current Task User)'
);
}
$_DBArray['eventomsgto'] = $paramTO;
if(isset($parameters->CC)){
$paramCC[] = Array('id'=>'char', 'name'=>'char');
foreach($parameters->CC as $item){
$row = explode('|', $item);
switch($row[0]){
case 'usr':
require_once('classes/model/Users.php');
$user = new Users();
if($row[1] == '-1'){
$value = '(Current Task User)';
} else {
$rec = $user->load($row[1]);
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass('groups');
$group = new Groups();
$rec = $group->load($row[1]);
$value = strip_tags($rec->getGrpTitle());
break;
case 'ext':
$value = htmlentities($row[1]);
break;
case 'dyn':
$value = htmlentities('@#'.$row[1]);
break;
}
$paramCC[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
}
$_DBArray['eventomsgcc'] = $paramCC;
if (isset( $parameters->CC )) {
$paramCC[] = Array ('id' => 'char','name' => 'char' );
foreach ($parameters->CC as $item) {
$row = explode( '|', $item );
switch ($row[0]) {
case 'usr':
require_once ('classes/model/Users.php');
$user = new Users();
if ($row[1] == '-1') {
$value = '(Current Task User)';
} else {
$rec = $user->load( $row[1] );
$value = $rec['USR_FIRSTNAME'] . ' ' . $rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass( 'groups' );
$group = new Groups();
$rec = $group->load( $row[1] );
$value = strip_tags( $rec->getGrpTitle() );
break;
case 'ext':
$value = htmlentities( $row[1] );
break;
case 'dyn':
$value = htmlentities( '@#' . $row[1] );
break;
}
$paramCC[] = Array ('id' => replaceQuotes( $item ),'name' => $value
);
}
$_DBArray['eventomsgcc'] = $paramCC;
} else {
$_DBArray['eventomsgcc'] = Array();
$_DBArray['eventomsgcc'] = Array ();
}
if(isset($parameters->BCC)){
$paramBCC[] = Array('id'=>'char', 'name'=>'char');
foreach($parameters->BCC as $item){
$row = explode('|', $item);
switch($row[0]){
case 'usr':
require_once('classes/model/Users.php');
$user = new Users();
if($row[1] == '-1'){
$value = '(Current Task User)';
} else {
$rec = $user->load($row[1]);
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass('groups');
$group = new Groups();
$rec = $group->load($row[1]);
$value = strip_tags($rec->getGrpTitle());
break;
case 'ext':
$value = htmlentities($row[1]);
break;
case 'dyn':
$value = htmlentities('@#'.$row[1]);
break;
}
$paramBCC[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
}
$_DBArray['eventomsgbcc'] = $paramBCC;
if (isset( $parameters->BCC )) {
$paramBCC[] = Array ('id' => 'char','name' => 'char' );
foreach ($parameters->BCC as $item) {
$row = explode( '|', $item );
switch ($row[0]) {
case 'usr':
require_once ('classes/model/Users.php');
$user = new Users();
if ($row[1] == '-1') {
$value = '(Current Task User)';
} else {
$rec = $user->load( $row[1] );
$value = $rec['USR_FIRSTNAME'] . ' ' . $rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass( 'groups' );
$group = new Groups();
$rec = $group->load( $row[1] );
$value = strip_tags( $rec->getGrpTitle() );
break;
case 'ext':
$value = htmlentities( $row[1] );
break;
case 'dyn':
$value = htmlentities( '@#' . $row[1] );
break;
}
$paramBCC[] = Array ('id' => replaceQuotes( $item ),'name' => $value);
}
$_DBArray['eventomsgbcc'] = $paramBCC;
} else {
$_DBArray['eventomsgbcc'] = Array();
$_DBArray['eventomsgbcc'] = Array ();
}
$aFields['EVN_MESSAGE_TO_TO'] = $paramTO;
$aFields['EVN_MESSAGE_TO_CC'] = (isset($parameters->CC) ? $paramCC : '');
$aFields['EVN_MESSAGE_TO_BCC'] = (isset($parameters->BCC) ? $paramBCC : '');
$aFields['EVN_MESSAGE_TEMPLATE'] = (isset($parameters->TEMPLATE) ? $parameters->TEMPLATE : '');
$aFields['EVN_MESSAGE_TO_TO'] = $paramTO;
$aFields['EVN_MESSAGE_TO_CC'] = (isset( $parameters->CC ) ? $paramCC : '');
$aFields['EVN_MESSAGE_TO_BCC'] = (isset( $parameters->BCC ) ? $paramBCC : '');
$aFields['EVN_MESSAGE_TEMPLATE'] = (isset( $parameters->TEMPLATE ) ? $parameters->TEMPLATE : '');
$aTemplates = array();
$aTemplates[] = array('TEMPLATE1' => 'char',
'TEMPLATE2' => 'char');
$aTemplates = array ();
$aTemplates[] = array ('TEMPLATE1' => 'char','TEMPLATE2' => 'char');
$sDirectory = PATH_DATA_MAILTEMPLATES . $aFields['PRO_UID'] . PATH_SEP;
G::verifyPath($sDirectory, true);
if (!file_exists($sDirectory . 'alert_message.html')) {
@copy(PATH_TPL . 'mails' . PATH_SEP . 'alert_message.html', $sDirectory . 'alert_message.html');
G::verifyPath( $sDirectory, true );
if (! file_exists( $sDirectory . 'alert_message.html' )) {
@copy( PATH_TPL . 'mails' . PATH_SEP . 'alert_message.html', $sDirectory . 'alert_message.html' );
}
$oDirectory = dir($sDirectory);
$oDirectory = dir( $sDirectory );
while ($sObject = $oDirectory->read()) {
if (($sObject !== '.') && ($sObject !== '..') && ($sObject !== 'alert_message.html')) {
$aTemplates[] = array('TEMPLATE1' => $sObject,
'TEMPLATE2' => $sObject);
}
if (($sObject !== '.') && ($sObject !== '..') && ($sObject !== 'alert_message.html')) {
$aTemplates[] = array ('TEMPLATE1' => $sObject,'TEMPLATE2' => $sObject);
}
}
$_DBArray['templates'] = $aTemplates;
$aTriggers[] = array('TRI_UID' => 'char',
'TRI_TITLE' => 'char');
G::LoadClass('processMap');
$aTriggers[] = array ('TRI_UID' => 'char','TRI_TITLE' => 'char');
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oDataset = TriggersPeer::doSelectRS($oProcessMap->getTriggersCriteria($aFields['PRO_UID']));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset = TriggersPeer::doSelectRS( $oProcessMap->getTriggersCriteria( $aFields['PRO_UID'] ) );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aTriggers[] = array('TRI_UID' => $aRow['TRI_UID'],
'TRI_TITLE' => $aRow['TRI_TITLE']);
$oDataset->next();
$aTriggers[] = array ('TRI_UID' => $aRow['TRI_UID'],'TRI_TITLE' => $aRow['TRI_TITLE'] );
$oDataset->next();
}
$_DBArray['triggers'] = $aTriggers;
$_SESSION['_DBArray'] = $_DBArray;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave');
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave' );
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave');
G::RenderPage('publish', 'raw');
G::RenderPage( 'publish', 'raw' );
function replaceQuotes($aData){
return str_replace('"', '&quote;', $aData);
function replaceQuotes ($aData)
{
return str_replace( '"', '&quote;', $aData );
}

View File

@@ -12,50 +12,49 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
global $_DBArray;
G::LoadClass('tasks');
G::LoadClass('processMap');
G::LoadClass( 'tasks' );
G::LoadClass( 'processMap' );
$oTasks = new Tasks();
$aAux1 = $oTasks->getAllTasks($_GET['PRO_UID']);
$aTasks = array();
$aTasks[] = array('TAS_UID' => 'char', 'TAS_TITLE' => 'char');
$oTasks = new Tasks();
$aAux1 = $oTasks->getAllTasks( $_GET['PRO_UID'] );
$aTasks = array ();
$aTasks[] = array ('TAS_UID' => 'char','TAS_TITLE' => 'char');
//g::pr($aAux1);die;
foreach ($aAux1 as $aAux2) {
if ($aAux2['TAS_TYPE'] != 'SUBPROCESS') {
$aTasks[] = array('TAS_UID' => $aAux2['TAS_UID'], 'TAS_TITLE' => $aAux2['TAS_TITLE']);
}
if ($aAux2['TAS_TYPE'] != 'SUBPROCESS') {
$aTasks[] = array ('TAS_UID' => $aAux2['TAS_UID'],'TAS_TITLE' => $aAux2['TAS_TITLE']);
}
}
$oProcessMap = new processMap(new DBConnection);
$aTriggersList = $oProcessMap->getTriggers($_SESSION['PROCESS']);
$aTriggersFileds = Array('TRI_UID'=>'char', 'TRI_TITLE'=>'char');
$oProcessMap = new processMap( new DBConnection() );
$aTriggersList = $oProcessMap->getTriggers( $_SESSION['PROCESS'] );
$aTriggersFileds = Array ('TRI_UID' => 'char','TRI_TITLE' => 'char');
foreach($aTriggersList as $i=>$v){
unset($aTriggersList[$i]['PRO_UID']);
unset($aTriggersList[$i]['TRI_DESCRIPTION']);
$aTriggersList[$i]['TRI_TITLE'] = (strlen($aTriggersList[$i]['TRI_TITLE'])>32)? substr($aTriggersList[$i]['TRI_TITLE'], 0, 32).'...': $aTriggersList[$i]['TRI_TITLE'];
foreach ($aTriggersList as $i => $v) {
unset( $aTriggersList[$i]['PRO_UID'] );
unset( $aTriggersList[$i]['TRI_DESCRIPTION'] );
$aTriggersList[$i]['TRI_TITLE'] = (strlen( $aTriggersList[$i]['TRI_TITLE'] ) > 32) ? substr( $aTriggersList[$i]['TRI_TITLE'], 0, 32 ) . '...' : $aTriggersList[$i]['TRI_TITLE'];
}
$aTriggersList = array_merge(Array($aTriggersFileds), $aTriggersList);
$aTriggersList = array_merge( Array ($aTriggersFileds), $aTriggersList );
$_DBArray['tasks'] = $aTasks;
$_DBArray['TMP_TRIGGERS'] = $aTriggersList;
@@ -63,6 +62,6 @@ $_DBArray['TMP_TRIGGERS'] = $aTriggersList;
$_SESSION['_DBArray'] = $_DBArray;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsNew', '', array('PRO_UID' => $_GET['PRO_UID'], 'EVN_ACTION' => $_GET['EVN_TYPE']), '');
G::RenderPage('publish', 'raw');
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'events/eventsNew', '', array ('PRO_UID' => $_GET['PRO_UID'],'EVN_ACTION' => $_GET['EVN_TYPE']), '' );
G::RenderPage( 'publish', 'raw' );

View File

@@ -12,37 +12,36 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
global $_DBArray;
//get the posted fields of new Event and create a new record of that
//get the posted fields of new Event and create a new record of that
require_once 'classes/model/Event.php';
$oEvent = new Event();
$envUId = $oEvent->create($_POST);
$envUId = $oEvent->create( $_POST );
$_SESSION['EVN_UID'] = $envUId;
require_once ( 'eventsEditAction.php' );
die;
require_once ('eventsEditAction.php');
die();
/*
//this page is showing the parameters for setup email messages and triggers,
//this page is showing the parameters for setup email messages and triggers,
//probably this will be changed soon.
$aTemplates = array();
@@ -80,4 +79,5 @@ $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/events_EditAction', '', $_POST, '../events/eventsSave');
G::RenderPage('publish', 'raw');
*/
*/

View File

@@ -12,27 +12,27 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
require_once 'classes/model/AppEvent.php';
$oAppEvent = new AppEvent();
global $G_PUBLISH;
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'events/appEventsList', $oAppEvent->getAppEventsCriteria($_GET['PRO_UID'], 'PENDING', $_GET['EVN_TYPE']));
G::RenderPage('publish', 'raw');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'events/appEventsList', $oAppEvent->getAppEventsCriteria( $_GET['PRO_UID'], 'PENDING', $_GET['EVN_TYPE'] ) );
G::RenderPage( 'publish', 'raw' );

View File

@@ -12,66 +12,59 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
}
$EVN_MESSAGE_TO_TO = isset($_POST['form']['EVN_MESSAGE_TO_TO'])? replaceQuotes($_POST['form']['EVN_MESSAGE_TO_TO']): Array();
$EVN_MESSAGE_TO_CC = isset($_POST['form']['EVN_MESSAGE_TO_CC'])? replaceQuotes($_POST['form']['EVN_MESSAGE_TO_CC']): Array();
$EVN_MESSAGE_TO_BCC = isset($_POST['form']['EVN_MESSAGE_TO_BCC'])? replaceQuotes($_POST['form']['EVN_MESSAGE_TO_BCC']): Array();
$EVN_MESSAGE_TO_TO = isset( $_POST['form']['EVN_MESSAGE_TO_TO'] ) ? replaceQuotes( $_POST['form']['EVN_MESSAGE_TO_TO'] ) : Array ();
$EVN_MESSAGE_TO_CC = isset( $_POST['form']['EVN_MESSAGE_TO_CC'] ) ? replaceQuotes( $_POST['form']['EVN_MESSAGE_TO_CC'] ) : Array ();
$EVN_MESSAGE_TO_BCC = isset( $_POST['form']['EVN_MESSAGE_TO_BCC'] ) ? replaceQuotes( $_POST['form']['EVN_MESSAGE_TO_BCC'] ) : Array ();
if (isset($_POST['form']['EVN_MESSAGE_SUBJECT'])) {
$_POST['form']['EVN_ACTION_PARAMETERS'] = array(
'SUBJECT' => $_POST['form']['EVN_MESSAGE_SUBJECT'],
'TO' => $EVN_MESSAGE_TO_TO,
'CC' => $EVN_MESSAGE_TO_CC,
'BCC' => $EVN_MESSAGE_TO_BCC,
'TEMPLATE' => $_POST['form']['EVN_MESSAGE_TEMPLATE']
);
unset($_POST['form']['EVN_MESSAGE_SUBJECT']);
unset($_POST['form']['EVN_MESSAGE_TO_TO']);
unset($_POST['form']['EVN_MESSAGE_TO_CC']);
unset($_POST['form']['EVN_MESSAGE_TO_BCC']);
unset($_POST['form']['EVN_MESSAGE_TEMPLATE']);
if (isset( $_POST['form']['EVN_MESSAGE_SUBJECT'] )) {
$_POST['form']['EVN_ACTION_PARAMETERS'] = array ('SUBJECT' => $_POST['form']['EVN_MESSAGE_SUBJECT'],'TO' => $EVN_MESSAGE_TO_TO,'CC' => $EVN_MESSAGE_TO_CC,'BCC' => $EVN_MESSAGE_TO_BCC,'TEMPLATE' => $_POST['form']['EVN_MESSAGE_TEMPLATE']);
unset( $_POST['form']['EVN_MESSAGE_SUBJECT'] );
unset( $_POST['form']['EVN_MESSAGE_TO_TO'] );
unset( $_POST['form']['EVN_MESSAGE_TO_CC'] );
unset( $_POST['form']['EVN_MESSAGE_TO_BCC'] );
unset( $_POST['form']['EVN_MESSAGE_TEMPLATE'] );
}
unset($_POST['form']['SAVE']);
unset( $_POST['form']['SAVE'] );
require_once 'classes/model/Event.php';
$oEvent = new Event();
if ($_POST['form']['EVN_UID'] == '') {
//this is probably not used, because the creation of one Event is done directly in EventsNewAction
$oEvent->create($_POST['form']);
}
else {
/*
*if($_POST['form']['EVN_ACTION'] == 'SEND_MESSAGE' && $ev->getTriUid() != trim($_POST['form']['TRI_UID']) ){
//this is probably not used, because the creation of one Event is done directly in EventsNewAction
$oEvent->create( $_POST['form'] );
} else {
/*
*if($_POST['form']['EVN_ACTION'] == 'SEND_MESSAGE' && $ev->getTriUid() != trim($_POST['form']['TRI_UID']) ){
$oEvnActionParameters = unserialize($ev->getEvnActionParameters());
prit_r($oEvnActionParameters);
if( isset($oEvnActionParameters->TRI_UID) ){
$_POST['form']['TRI_UID'] = $oEvnActionParameters->TRI_UID;
}
}
*/
$oEvent->update($_POST['form']);
}
*/
$oEvent->update( $_POST['form'] );
}
function replaceQuotes ($aData)
{
for ($i = 0; $i < sizeof( $aData ); $i ++) {
$aData[$i] = str_replace( "&quote;", '"', $aData[$i] );
}
return $aData;
}
function replaceQuotes($aData){
for($i=0; $i<sizeof($aData); $i++){
$aData[$i] = str_replace("&quote;", '"', $aData[$i]);
}
return $aData;
}

View File

@@ -1,217 +1,239 @@
<?php
$w = 350;
$h = 90;
$w = 350;
$h = 90;
//how many task, single task or multiple
$t = isset( $_GET['t'] ) ? $_GET['t'] : 's';
if ( $t != 's' ) $t = 'm';
//how many task, single task or multiple
$t = isset( $_GET['t'] ) ? $_GET['t'] : 's';
if ($t != 's') {
$t = 'm';
}
//when occurs, after time elapses or when starting
$o = isset( $_GET['o'] ) ? $_GET['o'] : 's';
if ( $t != 's' ) $t = 'a';
//when occurs, after time elapses or when starting
$o = isset( $_GET['o'] ) ? $_GET['o'] : 's';
if ($t != 's') {
$t = 'a';
}
//status
$s = isset( $_GET['s'] ) ? $_GET['s'] : 'a';
if ( $s != 'a' ) $s = 'i';
//status
$s = isset( $_GET['s'] ) ? $_GET['s'] : 'a';
if ($s != 'a') {
$s = 'i';
}
//timeUnit
$timeunit = isset( $_GET['t'] ) ? $_GET['t'] : 'Days';
$timeunit = ucfirst(strtolower($timeunit));
//estimated
$estimated = abs( isset( $_GET['e'] ) ? (($timeunit == 'Hours')? round($_GET['e']/24,2):$_GET['e']) : '1' );
//timeUnit
$timeunit = isset( $_GET['t'] ) ? $_GET['t'] : 'Days';
$timeunit = ucfirst( strtolower( $timeunit ) );
//when
$when = isset( $_GET['w'] ) ? $_GET['w'] : '0';
$im = imagecreate($w,$h);
$bg = imagecolorallocate ($im, 0xFF, 0xFF, 0xFF);
$fg = imagecolorallocate ($im, 0x00, 200, 0x00);
$sc = imagecolorallocate ($im, 200, 0, 0);
$gray = imagecolorallocate ($im, 180,180,180);
$red = imagecolorallocate ($im, 200, 0, 0);
$green = imagecolorallocate ($im, 0, 200, 0);
$blue = imagecolorallocate ($im, 0, 0, 200);
$black = imagecolorallocate ($im, 0, 0, 0);
//estimated
$estimated = abs( isset( $_GET['e'] ) ? (($timeunit == 'Hours') ? round( $_GET['e'] / 24, 2 ) : $_GET['e']) : '1' );
imagerectangle($im, 0, 0, $w-1, $h-1, $gray);
//when
$when = isset( $_GET['w'] ) ? $_GET['w'] : '0';
$im = imagecreate( $w, $h );
$bg = imagecolorallocate( $im, 0xFF, 0xFF, 0xFF );
$fg = imagecolorallocate( $im, 0x00, 200, 0x00 );
$sc = imagecolorallocate( $im, 200, 0, 0 );
$gray = imagecolorallocate( $im, 180, 180, 180 );
$red = imagecolorallocate( $im, 200, 0, 0 );
$green = imagecolorallocate( $im, 0, 200, 0 );
$blue = imagecolorallocate( $im, 0, 0, 200 );
$black = imagecolorallocate( $im, 0, 0, 0 );
imagerectangle( $im, 0, 0, $w - 1, $h - 1, $gray );
// $incM = $media/60;
// $mean = 60*$incM;
// $d = $varianza;
// if ( $d == 0 ) $d = 0.0001;
// $val1 = 1 / ( sqrt( 2*pi() *$d*$d ));
// $val1 = 1 / ( sqrt( 2*pi() *$d*$d ));
// $val2 = -( pow($mean-$mean,2) )/ (pow($d,2));
// $y = $val1 * exp ( $val2 );
// $y = $val1 * exp ( $val2 );
// $incY = 80/$y;
// $range = 90/ $d;
// $offsetX = 100 - $mean;
// $antY = null;
// for ( $x = $mean -$range*$d ; $x <= $mean +$range*$d; $x++ ) {
// $val1 = 1 / ( sqrt( 2*pi() *$d*$d ));
// $val1 = 1 / ( sqrt( 2*pi() *$d*$d ));
// $val2 = -( pow($x-$mean,2) )/ (pow($d,2));
// $y = $val1 * exp ( $val2 )*$incY;
// if ( $antY != null )
// $y = $val1 * exp ( $val2 )*$incY;
// if ( $antY != null )
// imageline($im, $x-1+$offsetX, $h - $antY-15, $x+$offsetX, $h-$y-15, $blue);
// $antY = $y;
// imageline($im, $x +$mean, $h , $x + $mean, $h-1, $red);
// }
function drawTask ( $im, $x1, $x2, $y, $h ) {
global $w;
$blue = imagecolorallocate ($im, 160, 160, 180);
$gray = imagecolorallocate ($im, 100, 100, 100);
$black = imagecolorallocate ($im, 0, 0, 0);
for ( $i = $y; $i < $h ; $i+= 2 ) {
imageline($im, $x1, $i, $x1 , $i, $gray);
imageline($im, $x2, $i, $x2 , $i, $gray);
function drawTask ($im, $x1, $x2, $y, $h)
{
global $w;
$blue = imagecolorallocate( $im, 160, 160, 180 );
$gray = imagecolorallocate( $im, 100, 100, 100 );
$black = imagecolorallocate( $im, 0, 0, 0 );
for ($i = $y; $i < $h; $i += 2) {
imageline( $im, $x1, $i, $x1, $i, $gray );
imageline( $im, $x2, $i, $x2, $i, $gray );
}
for ( $i = $x1; $i < $x2; $i+= 2 ) {
imageline($im, $i, $y-10 , $i, $y, $blue);
for ($i = $x1; $i < $x2; $i += 2) {
imageline( $im, $i, $y - 10, $i, $y, $blue );
}
imagerectangle($im, $x1, $y - 10, $x2, $y, $black);
};
imagerectangle( $im, $x1, $y - 10, $x2, $y, $black );
}
;
function smallTask ($im, $x1, $x2, $y ) {
$blue = imagecolorallocate ($im, 160, 160, 180);
$black = imagecolorallocate ($im, 0, 0, 0);
function smallTask ($im, $x1, $x2, $y)
{
$blue = imagecolorallocate( $im, 160, 160, 180 );
$black = imagecolorallocate( $im, 0, 0, 0 );
for ( $i = $x1; $i < $x2; $i+= 2 ) {
imageline($im, $i, $y-8 , $i, $y, $blue);
for ($i = $x1; $i < $x2; $i += 2) {
imageline( $im, $i, $y - 8, $i, $y, $blue );
}
imagerectangle($im, $x1, $y - 9, $x2 - 1, $y, $black);
}
function drawMultipleTask ( $im, $x1, $x2, $y, $h ) {
global $w;
$terca = ($x2 - $x1 ) / 3;
$blue = imagecolorallocate ($im, 160, 160, 180);
$gray = imagecolorallocate ($im, 100, 100, 100);
$black = imagecolorallocate ($im, 0, 0, 0);
imagerectangle( $im, $x1, $y - 9, $x2 - 1, $y, $black );
}
for ( $i = $y; $i < $h ; $i+= 2 ) {
imageline($im, $x2, $i, $x2 , $i, $gray);
function drawMultipleTask ($im, $x1, $x2, $y, $h)
{
global $w;
$terca = ($x2 - $x1) / 3;
$blue = imagecolorallocate( $im, 160, 160, 180 );
$gray = imagecolorallocate( $im, 100, 100, 100 );
$black = imagecolorallocate( $im, 0, 0, 0 );
for ($i = $y; $i < $h; $i += 2) {
imageline( $im, $x2, $i, $x2, $i, $gray );
}
for ( $i = $y-10; $i < $h ; $i+= 2 ) {
imageline($im, $x1, $i, $x1 , $i, $gray);
for ($i = $y - 10; $i < $h; $i += 2) {
imageline( $im, $x1, $i, $x1, $i, $gray );
}
smallTask ( $im, $x1 + 0*$terca, $x1 + 1*$terca, $y -12 );
smallTask ( $im, $x1 + 1*$terca, $x1 + 2*$terca, $y -6 );
smallTask ( $im, $x1 + 2*$terca, $x1 + 3*$terca, $y );
};
smallTask( $im, $x1 + 0 * $terca, $x1 + 1 * $terca, $y - 12 );
smallTask( $im, $x1 + 1 * $terca, $x1 + 2 * $terca, $y - 6 );
smallTask( $im, $x1 + 2 * $terca, $x1 + 3 * $terca, $y );
}
;
function drawTimerEvent ( $im, $x1, $y1, $h ) {
$blue = imagecolorallocate ($im, 160, 160, 180);
$red = imagecolorallocate ($im, 200, 100, 0);
$gray = imagecolorallocate ($im, 100, 100, 100);
$black = imagecolorallocate ($im, 0, 0, 0);
$yellow = imagecolorallocate ($im, 240, 240, 220);
function drawTimerEvent ($im, $x1, $y1, $h)
{
$blue = imagecolorallocate( $im, 160, 160, 180 );
$red = imagecolorallocate( $im, 200, 100, 0 );
$gray = imagecolorallocate( $im, 100, 100, 100 );
$black = imagecolorallocate( $im, 0, 0, 0 );
$yellow = imagecolorallocate( $im, 240, 240, 220 );
for ( $i = $y1 + 15; $i < $h ; $i+= 2 ) {
imageline($im, $x1, $i, $x1 , $i, $gray);
for ($i = $y1 + 15; $i < $h; $i += 2) {
imageline( $im, $x1, $i, $x1, $i, $gray );
}
ImageEllipse($im, $x1, $y1, 26, 26, $black);
ImageEllipse($im, $x1, $y1, 22, 22, $black);
ImageFilledEllipse($im, $x1, $y1, 16, 16, $yellow );
ImageEllipse($im, $x1, $y1, 16, 16, $red);
imageline($im, $x1 , $y1-8 , $x1, $y1+8, $red);
ImageEllipse( $im, $x1, $y1, 26, 26, $black );
ImageEllipse( $im, $x1, $y1, 22, 22, $black );
ImageFilledEllipse( $im, $x1, $y1, 16, 16, $yellow );
ImageEllipse( $im, $x1, $y1, 16, 16, $red );
imageline( $im, $x1, $y1 - 8, $x1, $y1 + 8, $red );
//imageline($im, $x1 , $y1+8 , $x1, $y1+6, $red);
imageline($im, $x1-8 , $y1 , $x1+8 , $y1, $red);
imageline($im, $x1-7 , $y1-4 , $x1+7 , $y1+4, $red);
imageline($im, $x1-4 , $y1-7 , $x1+4 , $y1+7, $red);
imageline($im, $x1+7 , $y1-4 , $x1-7 , $y1+4, $red);
imageline($im, $x1+4 , $y1-7 , $x1-4 , $y1+7, $red);
ImageFilledEllipse($im, $x1, $y1, 10, 10, $yellow );
imageline($im, $x1-1 , $y1+1 , $x1+1, $y1 - 5, $red);
imageline($im, $x1-1 , $y1+1 , $x1+3, $y1+1 , $red);
imageline( $im, $x1 - 8, $y1, $x1 + 8, $y1, $red );
imageline( $im, $x1 - 7, $y1 - 4, $x1 + 7, $y1 + 4, $red );
imageline( $im, $x1 - 4, $y1 - 7, $x1 + 4, $y1 + 7, $red );
imageline( $im, $x1 + 7, $y1 - 4, $x1 - 7, $y1 + 4, $red );
imageline( $im, $x1 + 4, $y1 - 7, $x1 - 4, $y1 + 7, $red );
ImageFilledEllipse( $im, $x1, $y1, 10, 10, $yellow );
imageline( $im, $x1 - 1, $y1 + 1, $x1 + 1, $y1 - 5, $red );
imageline( $im, $x1 - 1, $y1 + 1, $x1 + 3, $y1 + 1, $red );
}
}
imageline($im, 15, $h-19 , $w -15, $h-19, $red);
imageline($im, $w - 23, $h-23 , $w -15, $h-19, $red);
imageline($im, $w - 23, $h-15 , $w -15, $h-19, $red);
imagestring ($im, 2, $w -30 , $h -37, 'Days', $red);
imageline( $im, 15, $h - 19, $w - 15, $h - 19, $red );
imageline( $im, $w - 23, $h - 23, $w - 15, $h - 19, $red );
imageline( $im, $w - 23, $h - 15, $w - 15, $h - 19, $red );
imagestring( $im, 2, $w - 30, $h - 37, 'Days', $red );
if ( $estimated == 0 ) {
$s = 'i';
header("Content-Type: image/png");
imagepng($im);
die;
}
if ($estimated == 0) {
$s = 'i';
header( "Content-Type: image/png" );
imagepng( $im );
die();
}
if ( $t == 's' )
drawTask ( $im, 80, 220, $h - 30 , $h -15);
else
drawMultipleTask( $im, 80, 220, $h - 30 , $h -15);
if ($t == 's') {
drawTask( $im, 80, 220, $h - 30, $h - 15 );
} else {
drawMultipleTask( $im, 80, 220, $h - 30, $h - 15 );
}
//the zero
imagestring ($im, 3, 80 -4 , $h -16, '0', $black);
//the estimated
imagestring ($im, 2, 220 -4 , $h -16, $estimated, $black);
imagestring( $im, 3, 80 - 4, $h - 16, '0', $black );
//the estimated
imagestring( $im, 2, 220 - 4, $h - 16, $estimated, $black );
//when is negative and the event occurs at starting, then this event never will occurs
if ( $when < 0 && $o == 's' ) {
//when is negative and the event occurs at starting, then this event never will occurs
if ($when < 0 && $o == 's') {
$xTimer = 30;
imagestring ($im, 2, $xTimer -8 , $h -16, $when, $black);
imagestring( $im, 2, $xTimer - 8, $h - 16, $when, $black );
$s = 'i';
}
}
//when is negative and the event occurs after, then this event will occurs
if ( $when < 0 && $o == 'a' ) {
if ( abs($when) > abs($estimated) ) { //this event is before the start of the task, so will never occurs
$xTimer = 30;
$sWhen = abs($when) - abs($estimated);
imagestring ($im, 2, $xTimer -8 , $h -16, $sWhen, $black);
$s = 'i';
//when is negative and the event occurs after, then this event will occurs
if ($when < 0 && $o == 'a') {
if (abs( $when ) > abs( $estimated )) {
//this event is before the start of the task, so will never occurs
$xTimer = 30;
$sWhen = abs( $when ) - abs( $estimated );
imagestring( $im, 2, $xTimer - 8, $h - 16, $sWhen, $black );
$s = 'i';
}
if ( abs($when) < abs($estimated) ) { //this event is after the start of the task, drawing
$xTimer = 170;
$sWhen = $estimated + $when;
imagestring ($im, 2, $xTimer -4 , $h -16, $sWhen, $black);
if (abs( $when ) < abs( $estimated )) {
//this event is after the start of the task, drawing
$xTimer = 170;
$sWhen = $estimated + $when;
imagestring( $im, 2, $xTimer - 4, $h - 16, $sWhen, $black );
}
if ( abs($when) == abs($estimated) ) { //this event is exactly at starting
$xTimer = 80;
$sWhen = $estimated + $when;
imagestring ($im, 2, $xTimer -4 , $h -16, $sWhen, $black);
if (abs( $when ) == abs( $estimated )) {
//this event is exactly at starting
$xTimer = 80;
$sWhen = $estimated + $when;
imagestring( $im, 2, $xTimer - 4, $h - 16, $sWhen, $black );
}
}
}
//when is positive and the event occurs after, then this event will occurs
if ( $when > 0 && $o == 'a' ) {
$xTimer = 270;
$sWhen = $estimated + $when;
imagestring ($im, 2, $xTimer -4 , $h -16, $sWhen, $black);
}
//when is positive and the event occurs after, then this event will occurs
if ($when > 0 && $o == 'a') {
$xTimer = 270;
$sWhen = $estimated + $when;
imagestring( $im, 2, $xTimer - 4, $h - 16, $sWhen, $black );
}
//when is positive and the event occurs starting, then this event will occurs
if ( $when > 0 && $o == 's' ) {
if ( abs($when) < abs($estimated) ) $xTimer = 140;
if ( abs($when) > abs($estimated) ) $xTimer = 270;
if ( abs($when) == abs($estimated) ) $xTimer = 220;
imagestring ($im, 2, $xTimer -4 , $h -16, $when, $black);
}
//when is positive and the event occurs starting, then this event will occurs
if ($when > 0 && $o == 's') {
if (abs( $when ) < abs( $estimated )) {
$xTimer = 140;
}
if (abs( $when ) > abs( $estimated )) {
$xTimer = 270;
}
if (abs( $when ) == abs( $estimated )) {
$xTimer = 220;
}
imagestring( $im, 2, $xTimer - 4, $h - 16, $when, $black );
}
if ( $when == 0 ) {
$xTimer = ( $o == 's' ) ? 80: 220 ;
}
if ($when == 0) {
$xTimer = ($o == 's') ? 80 : 220;
}
if ( $s == 'a' ) {
drawTimerEvent ( $im, $xTimer, $h -70 , $h -15);
}
if ($s == 'a') {
drawTimerEvent( $im, $xTimer, $h - 70, $h - 15 );
}
header( "Content-Type: image/png" );
imagepng( $im );
die();
header("Content-Type: image/png");
imagepng($im);
die;

View File

@@ -1,10 +1,10 @@
<?php
/**
* triggers_Save.php
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -12,29 +12,27 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
require_once('classes/model/Triggers.php');
$oTrigger = new Triggers();
if ($_POST['form']['TRI_UID'] != '')
{
$oTrigger->load($_POST['form']['TRI_UID']);
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
return $RBAC_Response;
}
else
{
$oTrigger->create($_POST['form']);
$_POST['form']['TRI_UID']=$oTrigger->getTriUid();
require_once ('classes/model/Triggers.php');
$oTrigger = new Triggers();
if ($_POST['form']['TRI_UID'] != '') {
$oTrigger->load( $_POST['form']['TRI_UID'] );
} else {
$oTrigger->create( $_POST['form'] );
$_POST['form']['TRI_UID'] = $oTrigger->getTriUid();
}
$oTrigger->update($_POST['form']);
?>
$oTrigger->update( $_POST['form'] );