frontend/modules/elfind/src/elFinderVolumeLocalFileSystem.class.php
/**
     *  collaborationDialog for file or directory
     *
     * @param string $path
     * @return array
     */
collaborationDialog for file or directory
@param string $path
@return array
collaborationDialog for file or directory @param string $path @return array
protected function collaborationDialogCE($path)
    {
        $ret = $this->shareDialogCE($path);
        if ($ret['status']) {
            $UserCollaboration = UserCollaborations::findOne(['file_uuid' => $ret['data']['file_uuid']]);
            if ($UserCollaboration) {
                $User = Yii::$app->user->identity;
                $ret['collaboration_id'] = $UserCollaboration->collaboration_id;
                $ret['collaboration_owner'] = $UserCollaboration->user_id;
                $ret['collaboration_is_owner'] = ($UserCollaboration->user_id == $User->user_id);
                $query = "SELECT
                            *,
                            (CASE WHEN (t1.colleague_permission = :PERMISSION_OWNER) THEN 1 ELSE 0 END) as is_owner
                          FROM {{%user_colleagues}} as t1
                          WHERE (collaboration_id = :collaboration_id)
                          AND (colleague_status NOT IN (:STATUS_QUEUED_DEL))
                          ORDER BY is_owner DESC, t1.colleague_email ASC";
                $UserColleagues = Yii::$app->db->createCommand($query, [
                    'PERMISSION_OWNER'  => UserColleagues::PERMISSION_OWNER,
                    'STATUS_QUEUED_DEL' => UserColleagues::STATUS_QUEUED_DEL,
                    'collaboration_id'  => $ret['collaboration_id'],
                ])->queryAll();
                foreach ($UserColleagues as $colleague) {
                    $ret['colleagues'][] = UserColleagues::prepareColleagueDataFromArray($colleague);
                }
            }
        }
        return $ret;
    }
protected function collaborationDialogCE ( $ path ) { $ ret = $ this -> shareDialogCE ( $ path ) ; if ( $ ret [ 'status' ] ) { $ UserCollaboration = UserCollaborations :: findOne ( [ 'file_uuid' => $ ret [ 'data' ] [ 'file_uuid' ] ] ) ; if ( $ UserCollaboration ) { $ User = Yii :: $ app -> user -> identity ; $ ret [ 'collaboration_id' ] = $ UserCollaboration -> collaboration_id ; $ ret [ 'collaboration_owner' ] = $ UserCollaboration -> user_id ; $ ret [ 'collaboration_is_owner' ] = ( $ UserCollaboration -> user_id == $ User -> user_id ) ; $ query = " SELECT
                            *,
                            (CASE WHEN (t1.colleague_permission = :PERMISSION_OWNER) THEN 1 ELSE 0 END) as is_owner
                          FROM {{%user_colleagues}} as t1
                          WHERE (collaboration_id = :collaboration_id)
                          AND (colleague_status NOT IN (:STATUS_QUEUED_DEL))
                          ORDER BY is_owner DESC, t1.colleague_email ASC " ; $ UserColleagues = Yii :: $ app -> db -> createCommand ( $ query , [ 'PERMISSION_OWNER' => UserColleagues :: PERMISSION_OWNER , 'STATUS_QUEUED_DEL' => UserColleagues :: STATUS_QUEUED_DEL , 'collaboration_id' => $ ret [ 'collaboration_id' ] , ] ) -> queryAll ( ) ; foreach ( $ UserColleagues as $ colleague ) { $ ret [ 'colleagues' ] [ ] = UserColleagues :: prepareColleagueDataFromArray ( $ colleague ) ; } } } return $ ret ; }
collaborationDialog for file or directory
 @param string $path
 @return array
collaborationDialog for file or directory @param string $path @return array
/** @var \common\models\Users $User */ /*
                $UserColleagues = UserColleagues::find()
                    ->where([
                        'collaboration_id' => $ret['collaboration_id'],
                        //'colleague_status' => UserColleagues::STATUS_QUEUED_ADD,
                    ])
                    ->andWhere('colleague_status NOT IN (:STATUS_QUEUED_DEL)', [
                        'STATUS_QUEUED_DEL' => UserColleagues::STATUS_QUEUED_DEL,
                        //'STATUS_QUEUED_ADD' => UserColleagues::STATUS_QUEUED_ADD,
                    ])
                    //->andWhere('(user_id!=:user_id) OR (user_id IS NULL)', [':user_id' => $User->user_id])
                    ->all();
                */ /** @var \common\models\UserColleagues $colleague */ //$ret['colleagues'][] = UserColleagues::prepareColleagueData($colleague); //$ret['colleagues'] = UserColleagues::findAll(['file_id' => $ret['data']['file_id']]);