예제 #1
0
 public function saveTitlePosition($sProcessUID = '', $iX = 0, $iY = 0)
 {
     try {
         $oProcess = new Process();
         $aFields = $oProcess->load($sProcessUID);
         $aFields['PRO_UID'] = $sProcessUID;
         $aFields['PRO_TITLE_X'] = $iX;
         $aFields['PRO_TITLE_Y'] = $iY;
         $oProcess->update($aFields);
         return true;
     } catch (Exception $oError) {
         throw $oError;
     }
 }
예제 #2
0
    /**

     * disable all previous process with the parent $sProUid

     *

     * @param $sProUid process uid

     * @return void

     */

    public function disablePreviousProcesses ($sProUid)

    {

        //change status of process

        $oCriteria = new Criteria( 'workflow' );

        $oCriteria->add( ProcessPeer::PRO_PARENT, $sProUid );

        $oDataset = ProcessPeer::doSelectRS( $oCriteria );

        $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );

        $oDataset->next();

        $oProcess = new Process();

        while ($aRow = $oDataset->getRow()) {

            $aRow['PRO_STATUS'] = 'DISABLED';

            $aRow['PRO_UPDATE_DATE'] = 'now';

            $oProcess->update( $aRow );

            $oDataset->next();

        }

    }
예제 #3
0
    //#28
    $t->isa_ok($e, 'Exception', 'update() returns error when PRO_UID is not defined');
    //#29
    //  $t->is ( $e->getMessage(),   "This row doesn't exist!",   "update() This row doesn't exist!" );
    $t->todo(" {$e->getMessage}() This row doesn't exist!  <>  The row '' in table Process doesn't exist! " . " line 171");
}
//update with $fields
$newTitle = 'new title ' . rand(1000, 5000);
$newDescription = 'new Description ' . rand(1000, 5000);
$Fields['PRO_UID'] = $proUid;
$Fields['PRO_TITLE'] = $newTitle;
$Fields['PRO_PARENT'] = rand(1000, 5000);
$Fields['PRO_CREATE_DATE'] = 'now';
try {
    $obj = new Process();
    $res = $obj->update($Fields);
    //#30
    $t->is($res, 1, "update() update 1 row");
    $Fields = $obj->Load($proUid);
    //#26
    $t->is($obj->getproUid(), $proUid, "update() APP_UID = " . $proUid);
    //#27
    $t->is($obj->getProTitle(), $newTitle, "update() getAppTitle");
    //#28
    $t->is($Fields['PRO_TITLE'], $newTitle, "update() PRO_TITLE= " . $newTitle);
    //#29
    $t->is($Fields['PRO_CREATE_DATE'], date('Y-m-d H:i:s'), "update() PRO_CREATE_DATE= " . date('Y-m-d H:i:s'));
} catch (Exception $e) {
    //#14
    $t->isa_ok($e, 'PropelException', 'update() return error ' . $e->getMessage());
    print $e->getMessage();