當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Project類代碼示例

本文整理匯總了PHP中Project的典型用法代碼示例。如果您正苦於以下問題:PHP Project類的具體用法?PHP Project怎麽用?PHP Project使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Project類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: resources_handle_on_project_user_removed

/**
 * Handle on_project_user_removed event
 *
 * @param Project $project
 * @param User $user
 * @return null
 */
function resources_handle_on_project_user_removed($project, $user)
{
    $rows = db_execute('SELECT id FROM ' . TABLE_PREFIX . 'project_objects WHERE project_id = ?', $project->getId());
    if (is_foreachable($rows)) {
        $object_ids = array();
        foreach ($rows as $row) {
            $object_ids[] = (int) $row['id'];
        }
        // foreach
        $user_id = $user->getId();
        // Assignments cleanup
        db_execute('DELETE FROM ' . TABLE_PREFIX . 'assignments WHERE user_id = ? AND object_id IN (?)', $user_id, $object_ids);
        cache_remove('object_starred_by_' . $user_id);
        cache_remove('object_assignments_*');
        cache_remove('object_assignments_*_rendered');
        // Starred objects cleanup
        db_execute('DELETE FROM ' . TABLE_PREFIX . 'starred_objects WHERE user_id = ? AND object_id IN (?)', $user_id, $object_ids);
        cache_remove('object_starred_by_' . $user_id);
        // Subscriptions cleanup
        db_execute('DELETE FROM ' . TABLE_PREFIX . 'subscriptions WHERE user_id = ? AND parent_id IN (?)', $user_id, $object_ids);
        cache_remove('user_subscriptions_' . $user_id);
        // remove pinned project
        PinnedProjects::unpinProject($project, $user);
    }
    // if
}
開發者ID:NaszvadiG,項目名稱:activecollab_loc,代碼行數:33,代碼來源:on_project_user_removed.php

示例2: display

 function display()
 {
     $this->ev->process();
     //echo "<!-- \n";
     //var_dump($_REQUEST);
     //var_dump($this->ev->fieldDefs);
     //echo "-->";
     if (empty($this->ev->focus->id) && $_REQUEST['return_relationship'] == 'projects_cases') {
         $parent = new Project();
         $parent->retrieve($_REQUEST['return_id']);
         $accts = $parent->get_linked_beans('accounts', 'Account');
         $i = 0;
         $acctlist = array();
         foreach ($accts as $acct) {
             $acctlist[i] = $acct->id;
             $i++;
         }
         if (isset($parent->facility_c) && $this->ev->fieldDefs['jobnumber_c']['value'] == "") {
             $this->ev->fieldDefs['jobnumber_c']['value'] = $parent->jobnumber_c;
         }
         if ($i > 0 && $this->ev->fieldDefs['account_id']['value'] == "") {
             $this->ev->fieldDefs['account_id']['value'] = $acct->id;
             $this->ev->fieldDefs['account_name']['value'] = $acct->name;
         }
     }
     echo $this->ev->display();
 }
開發者ID:aldridged,項目名稱:airtap-sugar,代碼行數:27,代碼來源:view.edit.php

示例3: getProjects

 /**
  * Get the projects.
  *
  * @param  int  $Limit
  * @return void
  */
 protected function getProjects($limit = null)
 {
     $projects = $this->project->alphabetical()->take($limit)->get();
     foreach ($projects as $project) {
         Sitemap::addTag(route('projects.show', $project->slug), $project->updated_at, 'weekly', '0.8');
     }
 }
開發者ID:riehlemt,項目名稱:neontsunami,代碼行數:13,代碼來源:SitemapsController.php

示例4: addUserAsProjectAdmin

 public function addUserAsProjectAdmin(Project $project, PFUser $user)
 {
     $project_id = $this->da->escapeInt($project->getId());
     $user_id = $this->da->escapeInt($user->getId());
     $sql = "UPDATE user_group\n                SET admin_flags = 'A'\n                WHERE group_id = {$project_id}\n                  AND user_id = {$user_id}";
     return $this->update($sql);
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:7,代碼來源:UserPermissionsDao.class.php

示例5: getDashboardItemData

 public function getDashboardItemData()
 {
     $data = array();
     $project = new Project();
     $data['numberOfProjects'] = $project->Count("status = 'Active'");
     return $data;
 }
開發者ID:riazuddinahmed1,項目名稱:icehrm,代碼行數:7,代碼來源:ProjectsAdminManager.php

示例6: build

 public function build(Project $project, $revision = null, $flags = 0, $callback = null)
 {
     // project already has a running build
     if ($project->isBuilding() && Sismo::FORCE_BUILD !== ($flags & Sismo::FORCE_BUILD)) {
         return;
     }
     $this->builder->init($project, $callback);
     list($sha, $author, $date, $message) = $this->builder->prepare($revision, Sismo::LOCAL_BUILD !== ($flags & Sismo::LOCAL_BUILD));
     $commit = $this->storage->getCommit($project, $sha);
     // commit has already been built
     if ($commit && $commit->isBuilt() && Sismo::FORCE_BUILD !== ($flags & Sismo::FORCE_BUILD)) {
         return;
     }
     $commit = $this->storage->initCommit($project, $sha, $author, \DateTime::createFromFormat('Y-m-d H:i:s O', $date), $message);
     $process = $this->builder->build();
     if ($process->getExitCode() > 0) {
         $commit->setStatusCode('failed');
         $commit->setOutput(sprintf("[31mBuild failed[0m\n\n[33mOutput[0m\n%s\n\n[33m Error[0m%s", $process->getOutput(), $process->getErrorOutput()));
     } else {
         $commit->setStatusCode('success');
         $commit->setOutput($process->getOutput());
     }
     $this->storage->updateCommit($commit);
     if (Sismo::SILENT_BUILD !== ($flags & Sismo::SILENT_BUILD)) {
         foreach ($project->getNotifiers() as $notifier) {
             $notifier->notify($commit);
         }
     }
 }
開發者ID:richsage,項目名稱:Sismo,代碼行數:29,代碼來源:Sismo.php

示例7: __construct

 public function __construct(Project $project, $count, $selected)
 {
     $this->label = util_unconvert_htmlspecialchars($project->getPublicName());
     $this->count = $count;
     $this->value = $project->getGroupId();
     $this->selected = $selected;
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:7,代碼來源:SearchResultProjectsFacet.class.php

示例8: project

 public static function project($project_ID = NULL, $create = false)
 {
     if (!$project_ID) {
         global $ID;
         $project_ID = getNS($ID);
     }
     if (isset(self::$projects[$project_ID])) {
         return self::$projects[$project_ID];
     }
     $name = noNS($project_ID);
     $project_file = DOKU_DATA . implode('/', explode(':', $project_ID)) . "/{$name}.project";
     if (file_exists($project_file)) {
         $project = unserialize(file_get_contents($project_file));
         if (!method_exists($project, 'version') || $project->version() != PROJECTS_VERSION) {
             $project = new Project($project_ID);
             $project->rebuild();
         }
     } else {
         if ($create) {
             $project = new Project($project_ID);
         } else {
             return NULL;
         }
     }
     self::$projects[$project_ID] = $project;
     return $project;
 }
開發者ID:omusico,項目名稱:isle-web-framework,代碼行數:27,代碼來源:project.php

示例9: buildRequest

 /**
  * @return Codendi_Request
  */
 private function buildRequest(Project $project, SimpleXMLElement $xml_element)
 {
     $params['action'] = 'export';
     $params['project_id'] = $project->getID();
     $params['into_xml'] = $xml_element;
     return new Codendi_Request($params);
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:10,代碼來源:XMLFullStructureExporter.php

示例10: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $userToken = Input::get('token');
     $validation = Validator::make(['projectname' => Input::get('projectname'), 'description' => Input::get('description'), 'start_date' => Input::get('start_date'), 'end_date' => Input::get('end_date')], ['projectname' => 'required|min:4|max:40', 'description' => 'min:10|max:60', 'start_date' => 'required|date_format:"m/d/Y"', 'end_date' => 'required|date_format:"m/d/Y"']);
     if ($validation->fails()) {
         return Redirect::route('dashboard', array($userToken))->withErrors($validation);
     } else {
         $projectName = Input::get('projectname');
         $projectDesc = Input::get('description');
         $projectStart = Input::get('start_date');
         $start_day = date("Y-m-d", strtotime($projectStart));
         $projectEnd = Input::get('end_date');
         $end_day = date("Y-m-d", strtotime($projectEnd));
         $team_id = Input::get('team_id');
         try {
             $project = new Project();
             $project->project_title = $projectName;
             $project->project_desc = $projectDesc;
             $project->team_id = $team_id;
             $project->strat_date = $start_day;
             $project->end_date = $end_day;
             $project->save();
             return Redirect::route('dashboard', array($userToken));
         } catch (Exception $e) {
             echo $e;
             return 'Something is wrong!';
         }
     }
 }
開發者ID:Nabil5352,項目名稱:Team-Management-Application,代碼行數:34,代碼來源:ProjectController.php

示例11: iterateSubProjects

 private function iterateSubProjects(Project $project, $select, $value, $level = 0, $showmilestones = true)
 {
     $selected = $value == $project->id ? 'selected="selected"' : '';
     $disabled = '';
     if ($project->ismilestone) {
         if (!$showmilestones) {
             return "";
         }
         $disabled = $select == 'project' ? 'disabled="disabled"' : '';
     } else {
         $disabled = $select == 'milestone' ? 'disabled="disabled"' : '';
     }
     $prepend = '';
     for ($i = 0; $i < $level; $i++) {
         $prepend .= '&nbsp;&nbsp;&nbsp;&nbsp;';
     }
     if (isset($this->view->model->id) && $project->id == $this->view->model->id) {
         $disabled = 'disabled="disabled"';
     }
     $html = '<option value="' . $project->id . '" ' . $disabled . ' ' . $selected . '>' . $prepend . $this->view->escape($project->title) . " (" . $project->id . ")" . '</option>';
     $children = $project->getChildProjects();
     foreach ($children as $childProject) {
         $html .= "\n" . $this->iterateSubProjects($childProject, $select, $value, $level + 1);
     }
     return $html;
 }
開發者ID:nyeholt,項目名稱:relapse,代碼行數:26,代碼來源:ProjectSelector.php

示例12: getMatchingArtifacts

 public function getMatchingArtifacts(PFUser $user, Project $project, array $tracker_ids, Tracker_Hierarchy $hierarchy, Tracker_CrossSearch_Query $query, $excluded_artifact_ids = array())
 {
     $shared_fields = $this->shared_field_factory->getSharedFields($query->getSharedFields());
     $semantic_fields = $query->getSemanticCriteria();
     $artifacts_info = $this->dao->searchMatchingArtifacts($user, $project->getId(), $query, $tracker_ids, $shared_fields, $semantic_fields, $this->artifact_link_field_ids_for_column_display, $excluded_artifact_ids);
     return $this->result_sorter->buildTreeWithMissingChildren($user, $artifacts_info, $excluded_artifact_ids);
 }
開發者ID:rinodung,項目名稱:tuleap,代碼行數:7,代碼來源:Search.class.php

示例13: getProject

 public function getProject()
 {
     $buglist = $this->getBuglist();
     $project = new Project();
     $project->getByID($buglist->pr_id);
     return $project;
 }
開發者ID:Nikolas1995,項目名稱:curv-e,代碼行數:7,代碼來源:Bug.class.php

示例14: getOpenTimeslotTasks

 /**
  * Return tasks on which the user has an open timeslot
  *
  * @param User $user
  * @param Project $project
  * @return array
  */
 static function getOpenTimeslotTasks(User $user, User $logged_user, $project = null, $tag = null, $assigned_to_company = null, $assigned_to_user = null, $archived = false)
 {
     if ($project) {
         $project_ids = $project->getAllSubWorkspacesQuery(!$archived);
         $wsstring = " AND " . self::getWorkspaceString($project_ids);
     } else {
         $wsstring = "";
     }
     $openTimeslot = " AND id in (SELECT object_id from " . TABLE_PREFIX . "timeslots t WHERE user_id=" . $user->getId() . " AND t.object_manager='ProjectTasks' AND t.end_time='" . EMPTY_DATETIME . "')";
     $permissions = ' AND ( ' . permissions_sql_for_listings(ProjectTasks::instance(), ACCESS_LEVEL_READ, logged_user(), 'project_id') . ')';
     $tagStr = $tag ? " AND id in (SELECT rel_object_id from " . TABLE_PREFIX . "tags t WHERE tag=" . DB::escape($tag) . " AND t.rel_object_manager = 'ProjectTasks')" : '';
     $assignedToStr = "";
     if ($assigned_to_company) {
         if ($assigned_to_company == -1) {
             $assigned_to_company = 0;
         }
         $assignedToStr .= " AND `assigned_to_company_id` = " . DB::escape($assigned_to_company) . " ";
     }
     if ($assigned_to_user) {
         if ($assigned_to_user == -1) {
             $assigned_to_user = 0;
         }
         $assignedToStr .= " AND `assigned_to_user_id` = " . DB::escape($assigned_to_user) . " ";
     }
     if ($archived) {
         $archived_cond = "`archived_by_id` <> 0 ";
     } else {
         $archived_cond = "`archived_by_id` = 0 ";
     }
     $objects = self::findAll(array('conditions' => array('`is_template` = false AND ' . $archived_cond . $wsstring . $permissions . $tagStr . $assignedToStr . $openTimeslot), 'order' => 'due_date ASC, `created_on` DESC'));
     return $objects;
 }
開發者ID:pnagaraju25,項目名稱:fengoffice,代碼行數:39,代碼來源:ProjectTasks.class.php

示例15: _new

 public function _new()
 {
     parent::_new();
     $this->setTemplateName('calls_new');
     $projects = $opportunities = $activities = null;
     if (isset($this->_data['person_id'])) {
         $person = new Person();
         $person->load($this->_data['person_id']);
         $this->_data['company_id'] = $person->company_id;
         $projects = $person->projects;
         $opportunities = $person->opportunities;
         $activities = $person->activities;
         $this->view->set('person', $person->fullname);
     }
     if (isset($this->_data['company_id'])) {
         $company = new Company();
         $company->load($this->_data['company_id']);
         $projects = DataObjectCollection::Merge($company->projects, $projects);
         $opportunities = DataObjectCollection::Merge($company->opportunities, $opportunities);
         $activities = DataObjectCollection::Merge($company->activities, $activities);
         $this->view->set('company', $company->name);
     }
     if (isset($this->_data['project_id'])) {
         $project = new Project();
         $project->load($this->_data['project_id']);
         $this->_data['company_id'] = $project->company_id;
     }
     $this->view->set('projects', $projects);
     $this->view->set('opportunities', $opportunities);
     $this->view->set('activities', $activities);
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:31,代碼來源:LoggedcallsController.php


注:本文中的Project類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。