Merged master into dashboards2

This commit is contained in:
Dante Loayza
2015-04-27 15:32:37 -04:00
22 changed files with 152 additions and 57 deletions

View File

@@ -5,7 +5,7 @@
*/
if ( !defined('PATH_SEP') ) {
define('PATH_SEP', ( substr(PHP_OS, 0, 3) == 'WIN' ) ? '\\' : '/');
define("PATH_SEP", (substr(PHP_OS, 0, 3) == "WIN")? "\\" : "/");
}
$docuroot = explode(PATH_SEP, str_replace('engine' . PATH_SEP . 'methods' . PATH_SEP . 'services', '', dirname(__FILE__)));
@@ -129,7 +129,7 @@ if ($force || !$bCronIsRunning) {
$oDirectory = dir(PATH_DB);
$cws = 0;
while($sObject = $oDirectory->read()) {
while (($sObject = $oDirectory->read()) !== false) {
if (($sObject != ".") && ($sObject != "..")) {
if (is_dir(PATH_DB . $sObject)) {
if (file_exists(PATH_DB . $sObject . PATH_SEP . "db.php")) {
@@ -141,6 +141,10 @@ if ($force || !$bCronIsRunning) {
}
}
} else {
if (!is_dir(PATH_DB . $ws) || !file_exists(PATH_DB . $ws . PATH_SEP . "db.php")) {
throw new Exception("Error: The workspace \"$ws\" does not exist");
}
$cws = 1;
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" $ws \"$sDate\" \"$dateSystem\" $argsx", $retval);

View File

@@ -10,11 +10,6 @@ register_shutdown_function(
)
);
/**
* cron_single.php
* @package workflow-engine-bin
*/
if (!defined('SYS_LANG')) {
define('SYS_LANG', 'en');
}
@@ -220,9 +215,6 @@ Bootstrap::registerClass('CaseTrackerObject', PATH_HOME . "engine/classes/mod
Bootstrap::registerClass('BaseCaseTrackerObjectPeer',PATH_HOME . "engine/classes/model/om/BaseCaseTrackerObjectPeer.php");
Bootstrap::registerClass('CaseTrackerObjectPeer', PATH_HOME . "engine/classes/model/CaseTrackerObjectPeer.php");
Bootstrap::registerClass('BaseConfiguration', PATH_HOME . "engine/classes/model/om/BaseConfiguration.php");
Bootstrap::registerClass('Configuration', PATH_HOME . "engine/classes/model/Configuration.php");
Bootstrap::registerClass('BaseDbSource', PATH_HOME . "engine/classes/model/om/BaseDbSource.php");
Bootstrap::registerClass('DbSource', PATH_HOME . "engine/classes/model/DbSource.php");
@@ -367,7 +359,7 @@ Bootstrap::registerClass("AddonsManagerPeer", PATH_HOME . "engine" . PATH_SEP
Bootstrap::registerClass('dashboards', PATH_HOME . "engine/classes/class.dashboards.php");
/*----------------------------------********---------------------------------*/
$arrayClass = array("EmailServer", "ListInbox", "ListParticipatedHistory");
$arrayClass = array("Configuration", "EmailServer", "ListInbox", "ListParticipatedHistory");
foreach ($arrayClass as $value) {
Bootstrap::registerClass("Base" . $value, PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "om" . PATH_SEP . "Base" . $value . ".php");

View File

@@ -114,6 +114,10 @@ try {
}
}
} else {
if (!is_dir(PATH_DB . $workspace) || !file_exists(PATH_DB . $workspace . PATH_SEP . "db.php")) {
throw new Exception("Error: The workspace \"$workspace\" does not exist");
}
$countw++;
passthru("php -f \"$messageEventCronSinglePath\" $workspace \"" . base64_encode(PATH_HOME) . "\" \"" . base64_encode(PATH_TRUNK) . "\" \"" . base64_encode(PATH_OUTTRUNK) . "\"");

View File

@@ -4100,6 +4100,7 @@ class Cases
$oApplication = new Application();
$aFields = $oApplication->load($sApplicationUID);
$appStatusCurrent = $aFields['APP_STATUS'];
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID);
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
@@ -4170,7 +4171,8 @@ class Cases
$data = array (
'APP_UID' => $sApplicationUID,
'DEL_INDEX' => $iIndex,
'USR_UID' => $user_logged
'USR_UID' => $user_logged,
'APP_STATUS_CURRENT' => $appStatusCurrent
);
$data = array_merge($aFields, $data);
$oListCanceled = new ListCanceled();

View File

@@ -399,23 +399,20 @@ class PMPluginRegistry
}
/**
* get status plugin in the singleton
* Get status plugin in the singleton
*
* @param unknown_type $sNamespace
* @param string $name Plugin name
*
* return mixed Return a string with status plugin, 0 otherwise
*/
public function getStatusPlugin ($sNamespace)
public function getStatusPlugin($name)
{
foreach ($this->_aPluginDetails as $namespace => $detail) {
if ($sNamespace == $namespace) {
if ($this->_aPluginDetails[$sNamespace]->enabled) {
return 'enabled';
} else {
return 'disabled';
try {
return (isset($this->_aPluginDetails[$name]))? (($this->_aPluginDetails[$name]->enabled)? "enabled" : "disabled") : 0;
} catch (Excepton $e) {
throw $e;
}
}
}
return 0;
}
/**
* Install a plugin archive.

View File

@@ -104,9 +104,21 @@ class ListCanceled extends BaseListCanceled {
$oListInbox->removeAll($data['APP_UID']);
$users = new Users();
if (!empty($data['APP_STATUS_CURRENT']) && $data['APP_STATUS_CURRENT'] == 'DRAFT') {
$users->refreshTotal($data['USR_UID'], 'removed', 'draft');
} else {
$users->refreshTotal($data['USR_UID'], 'removed', 'inbox');
}
$users->refreshTotal($data['USR_UID'], 'add', 'canceled');
//Update - WHERE
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(ListParticipatedLastPeer::APP_UID, $data["APP_UID"], Criteria::EQUAL);
//Update - SET
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(ListParticipatedLastPeer::APP_STATUS, 'CANCELLED');
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
$con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME );
try {
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );

View File

@@ -2,6 +2,7 @@
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
SET @@global.sql_mode='MYSQL40';
#-----------------------------------------------------------------------------
#-- APPLICATION

View File

@@ -149,16 +149,30 @@ try {
}
break;
case 'authSourcesNew':
$pluginRegistry = &PMPluginRegistry::getSingleton();
$arr = Array ();
$oDirectory = dir( PATH_RBAC . 'plugins' . PATH_SEP );
$aAuthSourceTypes = array ();
while ($sObject = $oDirectory->read()) {
if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) {
if (is_file( PATH_RBAC . 'plugins' . PATH_SEP . $sObject )) {
$sType = trim( str_replace( 'class.', '', str_replace( '.php', '', $sObject ) ) );
$aAuthSourceTypes['sType'] = $sType;
$aAuthSourceTypes['sLabel'] = $sType;
$arr[] = $aAuthSourceTypes;
$sType = trim(str_replace(array("class.", ".php"), "", $sObject));
$statusPlugin = $pluginRegistry->getStatusPlugin($sType);
$flagAdd = false;
if (preg_match("/^(?:enabled|disabled)$/", $statusPlugin)) {
if ($statusPlugin == "enabled") {
$flagAdd = true;
}
} else {
$flagAdd = true;
}
if ($flagAdd) {
$arr[] = array("sType" => $sType, "sLabel" => $sType);
}
}
}
}

View File

@@ -42,6 +42,12 @@ switch ($action) {
$urlProxy = 'proxyCasesList';
$action = 'unassigned';
break;
case 'to_revise':
$urlProxy = 'proxyCasesList';
break;
case 'to_reassign':
$urlProxy = 'proxyCasesList';
break;
}
/*----------------------------------********---------------------------------*/

View File

@@ -15,7 +15,7 @@
<tr>
{if $user_logged neq '' or $tracker neq ''}
<td rowspan="2" style="vertical-align:top;width: 245px;"><img src="{$logo_company}" class="logo_company"/></td>
<td class="mainMenuBG" rowspan="2" valign="center" >
<td id="mainMenuBG" class="mainMenuBG" rowspan="2" valign="center" >
{include file="$tpl_menu"}
{if (count($subMenus)>0) }
{include file= "$tpl_submenu"}

View File

@@ -861,15 +861,33 @@ class Cases
*
* @access public
* @param string $app_uid, Uid for case
* @param string $usr_uid, Uid user
* @return array
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*/
public function deleteCase($app_uid)
public function deleteCase($app_uid, $usr_uid)
{
Validator::isString($app_uid, '$app_uid');
Validator::appUid($app_uid, '$app_uid');
$criteria = new \Criteria();
$criteria->addSelectColumn( \ApplicationPeer::APP_STATUS );
$criteria->addSelectColumn( \ApplicationPeer::APP_INIT_USER );
$criteria->add( \ApplicationPeer::APP_UID, $app_uid, \Criteria::EQUAL );
$dataset = \ApplicationPeer::doSelectRS($criteria);
$dataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
if ($aRow['APP_STATUS'] != 'DRAFT') {
throw (new \Exception(\G::LoadTranslation("ID_DELETE_CASE_NO_STATUS")));
}
if ($aRow['APP_INIT_USER'] != $usr_uid) {
throw (new \Exception(\G::LoadTranslation("ID_DELETE_CASE_NO_OWNER")));
}
$case = new \Cases();
$case->removeCase( $app_uid );
}

View File

@@ -190,12 +190,11 @@ class FilesManager
break;
}
$content = $aData['prf_content'];
if (is_string($content)) {
if (file_exists($sDirectory) ) {
$directory = $sMainDirectory. PATH_SEP . $sSubDirectory . $aData['prf_filename'];
throw new \Exception(\G::LoadTranslation("ID_EXISTS_FILE", array($directory)));
}
}
if (!file_exists($sCheckDirectory)) {
$sPkProcessFiles = \G::generateUniqueID();
$oProcessFiles = new \ProcessFiles();
@@ -555,4 +554,3 @@ class FilesManager
}
}
}

View File

@@ -497,7 +497,10 @@ class BpmnWorkflow extends Project\Bpmn
//Setting as start Task
//or
//Remove as start Task
$bwp = new self;
if ($bwp->getActivity($arrayFlowData["FLO_ELEMENT_DEST"])) {
$this->wp->setStartTask($arrayFlowData["FLO_ELEMENT_DEST"], $flagStartTask);
}
break;
}
}
@@ -1384,6 +1387,10 @@ class BpmnWorkflow extends Project\Bpmn
$activity = $bwp->getActivity($activityData["ACT_UID"]);
if ($activity["BOU_CONTAINER"] != $activityData["BOU_CONTAINER"]) {
$activity = null;
}
if ($forceInsert || is_null($activity)) {
if ($generateUid) {
//Generate and update UID

View File

@@ -809,8 +809,9 @@ class Cases extends Api
public function doDeleteCase($cas_uid)
{
try {
$usr_uid = $this->getUserId();
$cases = new \ProcessMaker\BusinessModel\Cases();
$cases->deleteCase($cas_uid);
$cases->deleteCase($cas_uid, $usr_uid);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}

View File

@@ -317,6 +317,11 @@ CloseWindow = function(){
Ext.getCmp('w').hide();
};
SaveNewDepartment = function(){
if( newForm.getForm().findField('dep_name').getValue().trim() == "") {
Ext.Msg.alert(_('ID_WARNING'), _("ID_FIELD_REQUIRED", _("ID_DEPARTMENT_NAME")));
newForm.getForm().findField('dep_name').setValue("");
return false;
}
waitLoading.show();
var dep_node = Ext.getCmp('treePanel').getSelectionModel().getSelectedNode();
if (dep_node) dep_node.unselect();

View File

@@ -79,6 +79,7 @@
</head>
<body onresize="resizingFrame();">
<!--<div class="ui-layout-north">-->
<div class="loader"></div>
<section class="navBar" id="idNavBar">
<div class="head"></div>
<nav>

View File

@@ -182,7 +182,13 @@ Ext.onReady(function(){
text: _("ID_SAVE"),
handler: function (btn, ev)
{
if( newForm.getForm().findField('name').getValue().trim() == "") {
Ext.Msg.alert(_('ID_WARNING'), _("ID_FIELD_REQUIRED", _("ID_GROUP_NAME")));
newForm.getForm().findField('name').setValue("");
return false;
} else {
Ext.getCmp("btnCreateSave").setDisabled(true);
}
SaveNewGroupAction();
}

View File

@@ -207,10 +207,10 @@ Ext.onReady(function(){
Ext.Ajax.request({
url: 'checkDatabases',
success: function(response){
var existMsg = '<span style="color: red;">' + _('ID_EXIST') + '</span>';
var noExistsMsg = '<span style="color: green;">' + _('ID_NO_EXIST') + '</span>';
var existMsg = '<span style="color: red;">' + _('ID_NOT_AVAILABLE_DATABASE') + '</span>';
var noExistsMsg = '<span style="color: green;">' + _('ID_AVAILABLE_DATABASE') + '</span>';
var response = Ext.util.JSON.decode(response.responseText);
Ext.get('wfDatabaseSpan').dom.innerHTML = (response.wfDatabaseExists ? existMsg : noExistsMsg);
Ext.get('database_message').dom.innerHTML = (response.wfDatabaseExists ? existMsg : noExistsMsg);
var dbFlag = ((!response.wfDatabaseExists) || Ext.getCmp('deleteDB').getValue());
wizard.onClientValidation(4, dbFlag);
@@ -784,7 +784,7 @@ Ext.onReady(function(){
}),
{
xtype : 'textfield',
fieldLabel: _('ID_WF_DATABASE_NAME') + ' <span id="wfDatabaseSpan"></span>',
fieldLabel: _('ID_WF_DATABASE_NAME'),
id : 'wfDatabase',
value :'wf_workflow',
allowBlank : false,
@@ -799,6 +799,10 @@ Ext.onReady(function(){
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'displayfield',
id : 'database_message'
},
new Ext.form.Checkbox({
boxLabel : _('ID_DELETE_DATABASES'),
id : 'deleteDB',

View File

@@ -1402,7 +1402,11 @@ importProcessBpmnSubmit = function () {
return;
}
Ext.getCmp('importProcessWindow').close();
window.location.href = "../designer?prj_uid=" + resp_.prj_uid;
if (typeof(importProcessGlobal.processFileType) != "undefined" && importProcessGlobal.processFileType == "bpmn") {
openWindowIfIE("../designer?prj_uid=" + resp_.prj_uid);
} else {
window.location.href = "processes_Map?PRO_UID=" + resp_.prj_uid;
}
},
failure: function (o, resp) {
Ext.getCmp('importProcessWindow').close();

View File

@@ -25,6 +25,24 @@
document.getElementById('pm_submenu').style.display = 'none';
document.documentElement.style.overflowY = 'hidden';
function autoResizeScreen() {
var containerList1, containerList2;
oCasesFrame = document.getElementById('frameMain');
containerList1 = document.getElementById("pm_header");
if (document.getElementById("mainMenuBG") &&
document.getElementById("mainMenuBG").parentNode &&
document.getElementById("mainMenuBG").parentNode.parentNode &&
document.getElementById("mainMenuBG").parentNode.parentNode.parentNode &&
document.getElementById("mainMenuBG").parentNode.parentNode.parentNode.parentNode
){
containerList2 = document.getElementById("mainMenuBG").parentNode.parentNode.parentNode.parentNode;
}
if (containerList1 === containerList2) {
height = oClientWinSize.height - containerList1.clientHeight;
oCasesFrame.style.height = height;
if (oCasesFrame.height ) {
oCasesFrame.height = height;
}
} else {
oCasesFrame = document.getElementById('frameMain');
oClientWinSize = getClientWindowSize();
height = oClientWinSize.height-105;
@@ -32,6 +50,7 @@
if (oCasesFrame.height ) {
oCasesFrame.height = height;
}
}
//oCasesSubFrame = oCasesFrame.contentWindow.document.getElementById('casesSubFrame');
//oCasesSubFrame.style.height = height-10;
}

View File

@@ -6,7 +6,7 @@
<USR_USERNAME type="text" size="30" maxlength="50" required="true" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en>
</USR_USERNAME>
<USR_EMAIL type="text" size="30" required="true" maxlength="254" autocomplete="0">
<USR_EMAIL type="text" size="30" required="true" maxlength="100" autocomplete="0">
<en><![CDATA[Email]]></en>
</USR_EMAIL>
<URL type="hidden"/>

View File

@@ -16,7 +16,7 @@
{$form.updateButton}
</fieldset>
<div class="FormRequiredTextMessage"><font color="red">* </font>Required Field</div> </div>
<div class="FormRequiredTextMessage"></div>
<div class="boxBottom"><div class="a">&nbsp;</div><div class="b">&nbsp;</div><div class="c">&nbsp;</div></div>
</div>
<script type="text/javascript">