From 0451a4f4833c96b3886583cb49d8d6032bd748c2 Mon Sep 17 00:00:00 2001 From: Carlos Pacha Date: Wed, 16 Feb 2011 22:28:15 +0000 Subject: [PATCH] this bug 5818 was fixed, now we are setting the content values with default value(en) if these are not setting --- .../methods/cases/casesStartPage_Ajax.php | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/workflow/engine/methods/cases/casesStartPage_Ajax.php b/workflow/engine/methods/cases/casesStartPage_Ajax.php index 731e9222d..cf5623711 100755 --- a/workflow/engine/methods/cases/casesStartPage_Ajax.php +++ b/workflow/engine/methods/cases/casesStartPage_Ajax.php @@ -151,6 +151,60 @@ function ellipsis($text, $numb) { return $text; } + function lookinginforContentProcess($sproUid){ + require_once 'classes/model/Content.php'; + require_once 'classes/model/Task.php'; + require_once 'classes/model/Content.php'; + + $oContent = new Content(); + ///we are looking for a pro title for this process $sproUid + $oCriteria = new Criteria('workflow'); + $oCriteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE'); + $oCriteria->add( ContentPeer::CON_LANG, 'en'); + $oCriteria->add( ContentPeer::CON_ID, $sproUid); + $oDataset = ContentPeer::doSelectRS($oCriteria); + $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $oDataset->next(); + $aRow = $oDataset->getRow(); + if(!is_array($aRow)){ + + $oC = new Criteria('workflow'); + $oC->addSelectColumn(TaskPeer::TAS_UID); + $oC->add( TaskPeer::PRO_UID, $sproUid); + $oDataset1 = TaskPeer::doSelectRS($oC); + $oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC); + + while($oDataset1->next()){ + $aRow1 = $oDataset1->getRow(); + + $oCriteria1 = new Criteria('workflow'); + $oCriteria1->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE'); + $oCriteria1->add( ContentPeer::CON_LANG, SYS_LANG); + $oCriteria1->add( ContentPeer::CON_ID, $aRow1['TAS_UID']); + $oDataset2 = ContentPeer::doSelectRS($oCriteria1); + $oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $oDataset2->next(); + $aRow2 = $oDataset2->getRow(); + + Content::insertContent( 'TAS_TITLE', '', $aRow2['CON_ID'], 'en', $aRow2['CON_VALUE'] ); + } + $oC2 = new Criteria('workflow'); + $oC2->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE'); + $oC2->add( ContentPeer::CON_LANG, SYS_LANG); + $oC2->add( ContentPeer::CON_ID, $sproUid); + $oDataset3 = ContentPeer::doSelectRS($oC2); + $oDataset3->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $oDataset3->next(); + $aRow3 = $oDataset3->getRow(); + + Content::insertContent( 'PRO_TITLE', '', $aRow3['CON_ID'], 'en', $aRow3['CON_VALUE'] ); + + } + return 1; + + } + + function startCase() { G::LoadClass ( 'case' ); @@ -165,6 +219,9 @@ function startCase() { /* Process */ try { $oCase = new Cases ( ); + + lookinginforContentProcess($_POST['processId']); + $aData = $oCase->startCase ( $_REQUEST ['taskId'], $_SESSION ['USER_LOGGED'] ); $_SESSION ['APPLICATION'] = $aData ['APPLICATION']; $_SESSION ['INDEX'] = $aData ['INDEX']; @@ -279,4 +336,4 @@ function getDefaultDashboard(){ $defaultDashboard['defaultTab']=$_SESSION['__currentTabDashboard']; } print_r ( G::json_encode ( $defaultDashboard ) ); -} \ No newline at end of file +}