Пример #1
0
    /**

     * get all groups

     *

     * @param none

     * @return $result will return an object

     */

    public function groupList ()

    {

        try {

            $result = array ();

            $oCriteria = new Criteria( 'workflow' );

            $oCriteria->add( GroupwfPeer::GRP_STATUS, 'ACTIVE' );

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

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

            $oDataset->next();



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

                $oGroupwf = new Groupwf();

                $arrayGroupwf = $oGroupwf->Load( $aRow['GRP_UID'] );

                $result[] = array ('guid' => $aRow['GRP_UID'],'name' => $arrayGroupwf['GRP_TITLE']

                );

                $oDataset->next();

            }



            return $result;

        } catch (Exception $e) {

            $result[] = array ('guid' => $e->getMessage(),'name' => $e->getMessage()

            );



            return $result;

        }

    }
Пример #2
0
 /**
  * Get Groupwf Rows for a Process form an array
  *
  * @param array $aGroups
  * @return array $aGroupwf
  */
 public function getGroupwfRows($aGroups)
 {
     try {
         $aInGroups = array();
         foreach ($aGroups as $key => $val) {
             $aInGroups[] = $val['USR_UID'];
         }
         $aGroupwf = array();
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(GroupwfPeer::GRP_UID, $aInGroups, Criteria::IN);
         $oDataset = GroupwfPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $oGroupwf = new Groupwf();
             $aGroupwf[] = $oGroupwf->Load($aRow['GRP_UID']);
             $oDataset->next();
         }
         return $aGroupwf;
     } catch (Exception $oError) {
         throw $oError;
     }
 }
Пример #3
0
    /**

     * Merge groupwfs data

     *

     * @param array  $arrayGroupwfsData            Data groupwfs

     * @param array  $arrayData                    Data for merge

     * @param string $groupUidFieldNameInArrayData Field name of unique id

     *

     * return array Return an array with all groupwfs data

     */

    public function groupwfsMerge(array $arrayGroupwfsData, array $arrayData, $groupUidFieldNameInArrayData = "GRP_UID")

    {

        try {

            $arrayUid = array();



            foreach ($arrayGroupwfsData as $value) {

                $record = $value;



                $arrayUid[] = $record["GRP_UID"];

            }



            //Merge

            $groupwf = new Groupwf();



            foreach ($arrayData as $value) {

                $record = $value;



                if (isset($record[$groupUidFieldNameInArrayData]) && !in_array($record[$groupUidFieldNameInArrayData], $arrayUid)) {

                    $arrayGroupwfsData[] = $groupwf->Load($record[$groupUidFieldNameInArrayData]);

                }

            }



            //Return

            return $arrayGroupwfsData;

        } catch (Exception $e) {

            throw $e;

        }

    }
Пример #4
0
            G::header('location: ../login/login');
            die;
            break;
        case -2:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
        default:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
    }
}
if (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1) {
    return $RBAC_Response;
}
G::LoadClass('groups');
$dbc = new DBConnection();
$ses = new DBSession($dbc);
$group = new Groupwf();
$GrpUid = isset($_GET['UID']) ? urldecode($_GET['UID']) : '';
if ($GrpUid) {
    $aFields = $group->Load($GrpUid);
} else {
    $aFields = array();
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_Edit', '', $aFields, 'groups_Save');
G::RenderPage("publish", "raw");