protected function _initialize()
 {
     parent::_setup(self::B2DBNAME, self::ID);
     parent::_addVarchar(self::NAME, 100);
     parent::_addVarchar(self::KEY, 100);
     parent::_addVarchar(self::PREFIX, 5, '');
     parent::_addBoolean(self::USE_PREFIX);
     parent::_addBoolean(self::USE_SCRUM);
     parent::_addVarchar(self::HOMEPAGE, 200, '');
     parent::_addInteger(self::OWNER, 10);
     parent::_addInteger(self::OWNER_TYPE, 3);
     parent::_addInteger(self::LEAD_BY, 10);
     parent::_addInteger(self::LEAD_TYPE, 3);
     parent::_addText(self::DESCRIPTION, false);
     parent::_addVarchar(self::DOC_URL, 200, '');
     parent::_addBoolean(self::ALLOW_CHANGING_WITHOUT_WORKING);
     parent::_addBoolean(self::RELEASED);
     parent::_addBoolean(self::PLANNED_RELEASED);
     parent::_addInteger(self::RELEASE_DATE, 10);
     parent::_addBoolean(self::ENABLE_BUILDS);
     parent::_addBoolean(self::ENABLE_EDITIONS);
     parent::_addBoolean(self::ENABLE_COMPONENTS);
     parent::_addBoolean(self::SHOW_IN_SUMMARY, true);
     parent::_addVarchar(self::SUMMARY_DISPLAY, 15, 'issuetypes');
     parent::_addInteger(self::QA, 10);
     parent::_addInteger(self::QA_TYPE, 3);
     parent::_addBoolean(self::LOCKED);
     parent::_addForeignKeyColumn(self::SCOPE, TBGScopesTable::getTable(), TBGScopesTable::ID);
     parent::_addForeignKeyColumn(self::WORKFLOW_SCHEME_ID, TBGWorkflowSchemesTable::getTable(), TBGWorkflowSchemesTable::ID);
     parent::_addForeignKeyColumn(self::ISSUETYPE_SCHEME_ID, TBGIssuetypeSchemesTable::getTable(), TBGIssuetypeSchemesTable::ID);
     parent::_addForeignKeyColumn(self::CLIENT, TBGClientsTable::getTable(), TBGClientsTable::ID);
     parent::_addBoolean(self::DELETED);
     parent::_addBoolean(self::AUTOASSIGN);
 }
 public static function getAll()
 {
     if (self::$_clients === null) {
         self::$_clients = TBGClientsTable::getTable()->getAll();
     }
     return self::$_clients;
 }
 protected function _initialize()
 {
     parent::_setup(self::B2DBNAME, self::ID);
     parent::_addForeignKeyColumn(self::UID, TBGUsersTable::getTable());
     parent::_addForeignKeyColumn(self::CID, TBGClientsTable::getTable());
     parent::_addForeignKeyColumn(self::SCOPE, TBGScopesTable::getTable());
 }
Exemple #4
0
 /**
  * Performs quicksearch
  * 
  * @param TBGRequest $request The request object
  */
 public function runQuickSearch(TBGRequest $request)
 {
     if ($this->getUser()->canAccessConfigurationPage(TBGSettings::CONFIGURATION_SECTION_USERS)) {
         $this->found_users = TBGUsersTable::getTable()->findInConfig($this->searchterm, 10, false);
         $this->found_teams = TBGTeamsTable::getTable()->quickfind($this->searchterm);
         $this->found_clients = TBGClientsTable::getTable()->quickfind($this->searchterm);
         $this->num_users = count($this->found_users);
         $this->num_teams = count($this->found_teams);
         $this->num_clients = count($this->found_clients);
     }
     $found_projects = TBGProjectsTable::getTable()->quickfind($this->searchterm);
     $projects = array();
     foreach ($found_projects as $project) {
         if ($project->hasAccess()) {
             $projects[$project->getID()] = $project;
         }
     }
     $this->found_projects = $projects;
     $this->num_projects = count($projects);
 }
            continue;
        }
        ?>
														<?php 
        echo link_tag(make_url('team_dashboard', array('team_id' => $team->getID())), image_tag('tab_teams.png') . $team->getName());
        ?>
													<?php 
    }
    ?>
												</div>											
											</li>
										<?php 
}
?>
										<?php 
if (!TBGContext::isProjectContext() && ($tbg_user->hasPageAccess('clientlist') || count($tbg_user->getClients())) && !is_null(TBGClientsTable::getTable()->getAll())) {
    ?>
											<li<?php 
    if ($tbg_response->getPage() == 'client') {
        ?>
 class="selected"<?php 
    }
    ?>
>
												<div>
													<?php 
    echo link_tag('javascript:void(0)', image_tag('tab_clients.png') . __('Clients'), array('class' => 'not_clickable'));
    ?>
													<?php 
    echo javascript_link_tag(image_tag('tabmenu_dropdown.png', array('class' => 'menu_dropdown')), array('onmouseover' => ""));
    ?>
 public static function doesClientNameExist($client_name)
 {
     return TBGClientsTable::getTable()->doesClientNameExist($client_name);
 }
Exemple #7
0
 public function runAddClientMember(TBGRequest $request)
 {
     try {
         $user_id = (int) $request['user_id'];
         $client = TBGClientsTable::getTable()->selectById((int) $request['client_id']);
         $user = TBGUsersTable::getTable()->selectById($user_id);
         $client->addMember($user);
         return $this->renderJSON(array('clientlistitem' => $this->getTemplateHTML('configuration/clientuserlistitem', compact('client', 'user_id', 'user')), 'update_clients' => array('ids' => array($client->getID()), 'membercounts' => array($client->getID() => $client->getNumberOfMembers()))));
     } catch (Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => $e->getMessage()));
     }
 }