/**
  * Return manager instance
  *
  * @access protected
  * @param void
  * @return Workspaces 
  */
 function manager()
 {
     if (!$this->manager instanceof Workspaces) {
         $this->manager = Workspaces::instance();
     }
     return $this->manager;
 }
Example #2
0
$limit = 5;
$genid = gen_id();
$ws_dimension = Dimensions::findByCode('workspaces');
$dim_controller = new DimensionController();
$selected_ws = '0';
$allowed_members = array();
$add_ctx_members = true;
$show_widget = true;
$context = active_context();
if (isset($context)) {
    foreach ($context as $selection) {
        if ($selection instanceof Dimension && $selection->getCode() == 'workspaces') {
            $add_ctx_members = false;
        } else {
            if ($selection instanceof Member) {
                if ($selection->getObjectTypeId() == Workspaces::instance()->getObjectTypeId()) {
                    $allowed_members[] = $selection->getId();
                    $selected_ws = $selection->getId();
                } else {
                    $show_widget = false;
                }
            }
        }
    }
}
if ($show_widget) {
    $extra_conditions = " AND parent_member_id " . ($add_ctx_members && count($allowed_members) > 0 ? "IN (" . implode(",", $allowed_members) . ")" : "=0");
    $parent = null;
    $context = active_context();
    if (is_array($context)) {
        foreach ($context as $selection) {
Example #3
0
			
			var name = $(container).find("input.ws-name").val();

			if (name) {
				og.quickAddWs({
					name: name,
					parent: '<?php 
echo $members;
?>
',
					dim_id: '<?php 
echo $ws_dim->getId();
?>
',
					ot_id: '<?php 
echo Workspaces::instance()->getObjectTypeId();
?>
'
				},function(){
					og.customDashboard('dashboard', 'main_dashboard',{},true);
				});
				
			}else{
				alert('<?php 
echo lang('name required');
?>
');
				$(container).find("input.add-project-field").focus();
				container.removeClass("loading");
			}	
			
 /**
 * Return manager instance
 *
 * @access protected
 * @param void
 * @return Workspaces 
 */
 function manager() {
   if(!($this->manager instanceof Workspaces)) $this->manager = Workspaces::instance();
   return $this->manager;
 } // manager
 /**
  * Delete rows that match specific conditions. If $conditions is NULL all rows from table will be deleted
  *
  * @access public
  * @param string $conditions Query conditions
  * @return boolean
  */
 function delete($condition = null)
 {
     if (isset($this) && instance_of($this, 'Workspaces')) {
         return parent::delete($condition);
     } else {
         return Workspaces::instance()->delete($condition);
     }
     // if
 }
Example #6
0
<?php

$genid = gen_id();
$typeId = ObjectTypes::instance()->findByName("workspace")->getId();
//Check if There is a workspace in the active context
/* @var $member Member */
foreach (active_context_members(false) as $memberId) {
    $member = Members::instance()->findById($memberId);
    if ($member->getObjectTypeId() == $typeId) {
        $id = $member->getObjectId();
        if ($workspace = Workspaces::instance()->findById($id) && trim($member->getDescription()) != "") {
            $description = $member->getDescription();
            include_once 'template.php';
            break;
        }
    }
}
Example #7
0
<?php 
	$genid = gen_id();
	$id = get_id();
	$typeId= ObjectTypes::instance()->findByName("workspace")->getId();
	
	//Check if There is a workspace in the active context
	/* @var $member Member */ 
	foreach (active_context_members(false) as $memberId){
		$member = Members::instance()->findById($memberId);
		if ( $member->getObjectTypeId() == $typeId ) {
			$id = $member->getObjectId();
			
			if ($workspace = Workspaces::instance()->findById($id) ){
				if ( $workspace->getDescription() ) {
					include_once 'template.php';
				}
				break ;
			}
		} 
	}
	
Example #8
0
<?php
$total = 5;
$genid = gen_id();

$ws_dimension = Dimensions::findByCode('workspaces');
$dim_controller = new DimensionController();

$selected_ws = '0';
$allowed_members = array();
$add_ctx_members = true;
$context = active_context();
if(isset($context)){
	foreach ($context as $selection) {
		if ($selection instanceof Dimension && $selection->getCode() == 'workspaces') {
			$add_ctx_members = false;
		} else if ($selection instanceof Member && $selection->getObjectTypeId() == Workspaces::instance()->getObjectTypeId()) {
			$allowed_members[] = $selection->getId();
			$selected_ws = $selection->getId();
		}
	}	
}

$extra_conditions = " AND parent_member_id " . ($add_ctx_members && count($allowed_members) > 0 ? "IN (". implode(",", $allowed_members) .")" : "=0");

$workspaces = $dim_controller->initial_list_dimension_members($ws_dimension->getId(), null, null, false, $extra_conditions, $total, true);

$parent = null;
$context = active_context();
foreach ($context as $selection) {
	if ($selection instanceof Member && $selection->getDimensionId() == $ws_dimension->getId()) {
		$parent = $selection;