当前位置: 首页>>代码示例>>PHP>>正文


PHP Company::getAll方法代码示例

本文整理汇总了PHP中Company::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::getAll方法的具体用法?PHP Company::getAll怎么用?PHP Company::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Company的用法示例。


在下文中一共展示了Company::getAll方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: home

/**
* render home view @ingroup pages
*/
function home()
{
    global $PH;
    global $auth;
    ### create from handle ###
    $PH->defineFromHandle(array());
    $page = new Page();
    $page->cur_tab = 'home';
    $page->options = build_home_options();
    $page->title = __("Today");
    # $auth->cur_user->name;
    $page->type = __("At Home");
    $page->title_minor = renderTitleDate(time());
    ### page functions ###
    $page->add_function(new PageFunction(array('target' => 'personEdit', 'params' => array('person' => $auth->cur_user->id), 'icon' => 'edit', 'name' => __('Edit your Profile'))));
    $page->add_function(new PageFunction(array('target' => 'personAllItemsViewed', 'params' => array('person' => $auth->cur_user->id), 'icon' => 'edit', 'name' => __('Mark all items as viewed'))));
    echo new PageHeader();
    echo new PageContentOpen_Columns();
    measure_stop('init2');
    require_once confGet('DIR_STREBER') . 'db/class_company.inc.php';
    $block = new PageBlock(array('title' => __('Active projects'), 'id' => 'projects'));
    $block->render_blockStart();
    echo "<div class=linklist>";
    /**
     * get companies
     */
    foreach (Company::getAll() as $c) {
        /**
         * get project for company
         *
         * @NOTE single sql requests are not the fastes solution here...
         */
        if ($projects = Project::getAll(array('order_by' => 'c.name', 'company' => $c->id))) {
            echo "<span class=sub>" . __("for", "short for client") . '</span> <b>' . $c->getLink() . "</b>:";
            echo '<ul>';
            foreach ($projects as $project) {
                echo '<li>' . $PH->getLink('projView', $project->name, array('prj' => $project->id)) . '</li>';
            }
            echo '</ul>';
        }
    }
    if ($projects = Project::getAll(array('order_by' => 'c.name', 'company' => 0))) {
        echo __("without client");
        echo '<ul>';
        foreach ($projects as $project) {
            echo '<li>' . $PH->getLink('projView', $project->name, array('prj' => $project->id)) . '</li>';
        }
        echo '</ul>';
    }
    echo "</div>";
    $block->render_blockEnd();
    echo new PageContentNextCol();
    if ($projects = Project::getAll(array('order_by' => 'modified DESC'))) {
        require_once confGet('DIR_STREBER') . 'lists/list_recentchanges.inc.php';
        printRecentChanges($projects);
    }
    echo new PageContentClose();
    echo new PageHtmlEnd();
}
开发者ID:Bremaweb,项目名称:streber-1,代码行数:62,代码来源:home.inc.php

示例2: getVisibleById

 /**
  * query if visible for current user
  *
  * - returns NULL if failed
  * - this function is a double of validateView. Fix this
  */
 static function getVisibleById($id)
 {
     $companies = Company::getAll(array('order_str' => NULL, 'has_id' => intval($id)));
     if (count($companies) == 1) {
         if ($companies[0]->id) {
             return $companies[0];
         }
     }
     return NULL;
 }
开发者ID:Bremaweb,项目名称:streber-1,代码行数:16,代码来源:class_company.inc.php

示例3: print_automatic

 public function print_automatic()
 {
     global $PH;
     $this->active_block_function = 'list';
     $pass = true;
     ### add filter options ###
     foreach ($this->filters as $f) {
         foreach ($f->getQuerryAttributes() as $k => $v) {
             $this->query_options[$k] = $v;
         }
     }
     $companies = Company::getAll($this->query_options);
     $this->render_list($companies);
 }
开发者ID:Bremaweb,项目名称:streber-1,代码行数:14,代码来源:list_companies.inc.php

示例4: basicFields

 protected function basicFields($search)
 {
     // Search by Source
     $search->addSearchField('source', 'source', 'select', '', 'basic');
     $pp = new PeriodicPayment();
     $options = array('' => 'All');
     $sources = $pp->getEnumOptions('source');
     $options += $sources;
     $search->setOptions('source', $options);
     // Search by Frequency
     $search->addSearchField('frequency', 'frequency', 'select', '', 'basic');
     $options = array('' => 'All');
     $frequencies = $pp->getEnumOptions('frequency');
     $options += $frequencies;
     $search->setOptions('frequency', $options);
     // Search by Bank Account
     $search->addSearchField('cb_account_id', 'Bank Account', 'select', 0, 'advanced');
     $cb = new CBAccount();
     $cbs = $cb->getAll();
     $options = array('0' => 'All');
     $options += $cbs;
     $search->setOptions('cb_account_id', $options);
     // Search by Status
     $search->addSearchField('status', 'status', 'select', '', 'advanced');
     $options = array('' => 'All');
     $statuses = $pp->getEnumOptions('status');
     $options += $statuses;
     $search->setOptions('status', $options);
     // Search by Source
     $search->addSearchField('company_id', 'company', 'select', 0, 'advanced');
     $company = new Company();
     $options = array('0' => 'All');
     $companies = $company->getAll();
     $options += $companies;
     $search->setOptions('company_id', $options);
     // Search by Next Due Date
     $search->addSearchField('next_due_date', 'Due Between', 'between', '', 'advanced');
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:38,代码来源:PeriodicPaymentsSearch.php

示例5: personLinkCompanies

/**
* Link companies to person @ingroup pages
*/
function personLinkCompanies()
{
    global $PH;
    $id = getOnePassedId('person', 'people_*');
    # WARNS if multiple; ABORTS if no id found
    $person = Person::getEditableById($id);
    if (!$person) {
        $PH->abortWarning("ERROR: could not get Person");
        return;
    }
    $page = new Page(array('use_jscalendar' => true, 'autofocus_field' => 'company_name'));
    $page->cur_tab = 'people';
    $page->type = __("Edit Person");
    $page->title = sprintf(__("Edit %s"), $person->name);
    $page->title_minor = __("Add related companies");
    $page->crumbs = build_person_crumbs($person);
    $page->options[] = new NaviOption(array('target_id' => 'personLinkCompanies'));
    echo new PageHeader();
    echo new PageContentOpen();
    require_once confGet('DIR_STREBER') . 'pages/company.inc.php';
    require_once confGet('DIR_STREBER') . 'render/render_form.inc.php';
    $companies = Company::getAll();
    $list = new ListBlock_companies();
    $list->show_functions = false;
    $list->show_icons = false;
    $list->render_list($companies);
    $PH->go_submit = 'personLinkCompaniesSubmit';
    echo "<input type=hidden name='person' value='{$person->id}'>";
    echo "<input class=button2 type=submit>";
    echo new PageContentClose();
    echo new PageHtmlEnd();
}
开发者ID:Bremaweb,项目名称:streber-1,代码行数:35,代码来源:person.inc.php

示例6: Company

	   <div class="category-tab" ><!--category-tab-->
               <div class="col-sm-12">
                    
		</div>
                <div class="tab-content">
                  <div class="tab-pane fade active in" id="tshirt" >
                       <div> <input type="text" placeholder="Serch City"> <a href="<?php 
echo SERVER_URL;
?>
/add-jobs" > Post Jobs</a></div>
                    		<table id="example" class="display" cellspacing="0" width="77%" style="float: left;">
				
				<tbody>
                                    <?php 
$companyObj = new Company();
$result = $companyObj->getAll();
foreach ($result as $row) {
    ?>
                                    <tr class="trboder">
                                        <td >
                                            <div class="divdesc">
                                                <p><b>Name:</b> <?php 
    echo $row['name'];
    ?>
 <br/>
                                                 <b>City:</b> <?php 
    echo $row['city'];
    ?>
 <br/>
                                                 <b> Specialization:</b> <?php 
    echo $row['specialization'];
开发者ID:sonaljain888,项目名称:project-legal-lawyer-,代码行数:31,代码来源:jobs.php

示例7: foreach

<?php

if (system\Helper::arcIsAjaxRequest()) {
    $table = "<table class=\"table table-hover table-condensed\">" . "<thead><tr><th>Name</th><th># Users</th>" . "<th class=\"text-right\"><a onclick=\"editCompany(0);\" class=\"btn btn-primary btn-xs\"><i class=\"fa fa-plus\"></i> Create</a></th>" . "</tr></thead><tbody>";
    $companies = Company::getAll();
    foreach ($companies as $company) {
        $userCount = $company->getUsers();
        $table .= "<tr><td>{$company->name}</td>" . "<td>" . count($userCount) . "</td>" . "<td class=\"text-right\">" . "<div class=\"btn-group\" role=\"group\">" . "<a onclick=\"editCompany({$company->id});\" class=\"btn btn-success btn-xs\"><i class=\"fa fa-pencil\"></i> Edit</a>" . "<a onclick=\"removeCompany({$company->id});\" class=\"btn btn-danger btn-xs\"><i class=\"fa fa-remove\"></i> Remove</a>" . "</div>" . "</td></tr>";
    }
    $table .= "</tbody></table>";
    echo json_encode(["html" => $table]);
}
开发者ID:DeltaWolf7,项目名称:Arc,代码行数:12,代码来源:getcompanies.php

示例8: asset

									<input type="text" class="form-control" name="query" placeholder="Search for company.." />
								</div>

								<div class="col-sm-4">
									<button type="submit" name="searchBy" value="company" class="btn btn-primary">Search</button>
								</div>
							</div>
						</form>
					</div>

					<div class="panel-body">
						<?php 
if (\Input::has('searchBy') && \Input::get('query') !== '') {
    $companies = \Company::getByQuery(trim(\Input::get('query')), true, 15);
} else {
    $companies = \Company::getAll(true, 15);
}
?>
						@if (count($companies) > 0)
							<ul class="list-unstyled sc-list" id="companyAffiliateSearchList">
								@foreach ($companies as $company)
									<li>
										<div class="media">
											<div class="media-left">
												@if (! is_null($company->image))
												<img src="{{ asset($company->image) }}" width="52" />
												@else
												<img data-src="holder.js/52x52?random=yes&text=no-image" />
												@endif
											</div>
											<div class="media-body">
开发者ID:phantomlight,项目名称:programme-chameleon,代码行数:31,代码来源:list.blade.php

示例9: buildProjectSelector

/**
* renders the list of open projects that will be display when opening the project selector
*
* The opening is done with javascript. Placing the list beside the Project Selector icon
* is done by css only. This is a little bit tricky, because the Tab-list is already an
* span which allows only further Spans to be included...
*
* The selectorlist is triggered by 
*
* read more at #3867
*/
function buildProjectSelector()
{
    global $auth;
    if (!$auth->cur_user || !$auth->cur_user->id) {
        return "";
    }
    $buffer = "";
    global $PH;
    require_once confGet('DIR_STREBER') . 'db/class_company.inc.php';
    require_once confGet('DIR_STREBER') . "db/class_project.inc.php";
    $buffer .= "<span id=projectselector class=selector>&nbsp;</span>";
    $buffer .= "<span style='display:none;' id='projectselectorlist' class=selectorlist><span class=selectorlist_content>";
    foreach (Company::getAll() as $c) {
        if ($projects = Project::getAll(array('order_by' => 'c.name', 'company' => $c->id))) {
            $buffer .= "<div class='companies'><span style='float:left;margin-right:3px;'>" . __("for", "short for client") . "</span>" . $c->getLink() . "</div>";
            $buffer .= "<div class='projects'><ul>";
            foreach ($projects as $p) {
                $buffer .= "<li>" . $PH->getLink('projView', $p->name, array('prj' => $p->id)) . "</li>";
            }
            $buffer .= "</ul></div>";
        }
    }
    /* projects without client */
    if ($projects = Project::getAll(array('order_by' => 'c.name', 'company' => 0))) {
        $buffer .= "<div class='companies'><span style='float:left;margin-right:3px;'>" . __("without client", "short for client") . "</span>&nbsp;</div>";
        $buffer .= "<div class='projects'><ul>";
        foreach ($projects as $p) {
            $buffer .= "<li>" . $PH->getLink('projView', $p->name, array('prj' => $p->id)) . "</li>";
        }
        $buffer .= "</ul></div>";
    }
    $buffer .= "</span></span>";
    return $buffer;
}
开发者ID:Bremaweb,项目名称:streber-1,代码行数:45,代码来源:render_misc.inc.php

示例10: Company

        <th>Date</th>
        <th>City</th>
        <th>Location</th>
         <th>Website</th>
        <th>Email</th>
        <th>Phone</th>
        <th>Specialization</th>
        <th>Description</th>
        <th>Status</th>
        <th>Actions</th>
    </tr>
    </thead>
    <tbody>
     <?php 
$companyObj = new Company();
$rows = $companyObj->getAll();
foreach ($rows as $row) {
    ?>
 
    <tr>
             <td><?php 
    echo $row['id'];
    ?>
</td>
        <td class="center"><?php 
    echo $row['name'];
    ?>
</td>
        <td class="center"><?php 
    echo $row['date'];
    ?>
开发者ID:sonaljain888,项目名称:project-legal-lawyer-,代码行数:31,代码来源:company.php

示例11: request

 function request($params)
 {
     $errors = array();
     // Parse parameters.
     $p1 = $params->getParam(0);
     $subject = $p1->scalarval();
     $p2 = $params->getParam(1);
     $from_email = $p2->scalarval();
     $p3 = $params->getParam(2);
     $parts = array();
     foreach ($p3->scalarval() as $body) {
         $parts[] = $body->scalarval();
     }
     $content = $parts[0]['content'];
     $request = $content->scalarval();
     unset($parts[0]);
     $p4 = $params->getParam(3);
     $to_email = $p4->scalarval();
     /*
     - mandatory fields
      summary character varying NOT NULL,
       client_ticket_priority_id bigint NOT NULL,
       client_ticket_severity_id bigint NOT NULL,
       ticket_queue_id bigint NOT NULL,
       ticket_category_id bigint NOT NULL,
       internal_ticket_priority_id bigint NOT NULL,
       internal_ticket_severity_id bigint NOT NULL,
       internal_ticket_status_id bigint NOT NULL,
       client_ticket_status_id bigint NOT NULL,
     
     - optional fields
      originator_person_id character varying,
       originator_company_id bigint,
       company_sla_id bigint,
       action_code character varying(4),
       originator_email_address character varying,
       assigned_to character varying,
     */
     $config = Config::Instance();
     $companyid = '';
     $contact = new PartyContactMethodCollection(new PartyContactMethod());
     $sh = new SearchHandler($contact, false, false);
     $sh->addConstraint(new Constraint('name', '=', $config->get('TICKET_SUPPORT')));
     $sh->addConstraint(new Constraint('type', '=', 'E'));
     $sh->addConstraint(new Constraint('technical', 'is', TRUE));
     $sh->addConstraint(new Constraint('contact', '=', $to_email));
     $contact->load($sh);
     if ($contact->count() > 0) {
         $party_ids = array();
         foreach ($contact as $party) {
             $party_ids[] = $party->party_id;
             $usercompanyid = $party->usercompanyid;
         }
         if (!defined('EGS_COMPANY_ID')) {
             define('EGS_COMPANY_ID', $usercompanyid);
         }
         $company = new Company();
         $cc = new ConstraintChain();
         $cc->add(new Constraint('party_id', 'in', '(' . implode(',', $party_ids) . ')'));
         $companylist = $company->getAll($cc);
         if (count($companylist) != 1) {
             $errors[] = '1) Unable to find your support details - please contact technical support';
         } else {
             $company->load(key($companylist), true);
             $companyid = $company->id;
             $usercompanyid = $company->usercompanyid;
         }
     } else {
         $errors[] = '2) Unable to find your support details - please contact technical support';
     }
     $data['attachments'] = $parts;
     $data['TicketResponse']['body'] = $request;
     $data['TicketResponse']['type'] = 'site';
     $data['Ticket']['originator_company_id'] = $companyid;
     $data['reply_address'] = $to_email;
     $start = strpos($subject, '[');
     $end = strpos($subject, ']');
     $mid = strpos($subject, '-');
     if ($start > 0 && $mid > 0 && $end > 0 && $start < $end && $start < $mid && $mid < $end) {
         $ticket = substr($subject, $mid + 1, $end - $mid - 1);
     }
     if (empty($request)) {
         $errors[] = 'No request details submitted';
     } elseif (count($errors) == 0) {
         if (isset($ticket) && is_numeric($ticket)) {
             $data['TicketResponse']['ticket_id'] = $ticket;
             self::updateRequest($data, $errors);
             $response = "Your response for Ticket " . $ticket . " has been received. The person dealing with your query has been notified.";
         } else {
             $data['Ticket']['summary'] = $subject;
             $data['Ticket']['originator_email_address'] = $from_email;
             $data['Ticket']['usercompanyid'] = $usercompanyid;
             self::newRequest($data, $errors);
             $response = "Your request has been received and assigned ticket no. " . $data['TicketResponse']['ticket_id'] . ". A confirmation email has been sent.";
         }
     }
     if (count($errors) > 0) {
         $errors[] = $sh->constraints->__toString();
         $result = "ERROR\n";
         $response = "Subject:" . $subject . "\n";
//.........这里部分代码省略.........
开发者ID:uzerpllp,项目名称:uzerp,代码行数:101,代码来源:xmlrpcTicket.php

示例12: projEdit

/**
* Edit a project @ingroup pages
*/
function projEdit($project = NULL)
{
    global $PH;
    global $auth;
    require_once confGet('DIR_STREBER') . "db/class_company.inc.php";
    if (!$project) {
        $prj = getOnePassedId('prj', 'projects_*');
        ### get project ####
        if (!($project = Project::getEditableById($prj))) {
            $PH->abortWarning("could not get Project");
            return;
        }
    }
    $page = new Page(array('use_jscalendar' => true, 'autofocus_field' => 'project_name'));
    $page->cur_tab = 'projects';
    $page->type = __("Edit Project");
    $page->title = $project->name;
    $page->title_minor = $project->short;
    $page->crumbs = build_project_crumbs($project);
    $page->options[] = new NaviOption(array('target_id' => 'projEdit'));
    echo new PageHeader();
    echo new PageContentOpen();
    global $g_status_names;
    global $g_prio_names;
    require_once confGet('DIR_STREBER') . "render/render_form.inc.php";
    ### form background ###
    $block = new PageBlock(array('id' => 'project_edit'));
    $block->render_blockStart();
    $form = new PageForm();
    $form->button_cancel = true;
    $form->add($project->fields['name']->getFormElement($project));
    $form->add($tab_group = new Page_TabGroup());
    $tab_group->add($tab = new Page_Tab("project", __("Project")));
    $tab->add(new Form_Dropdown('project_status', "Status", array_flip($g_status_names), $project->status));
    ### build company-list ###
    $companies = Company::getAll();
    $cl_options = array('undefined' => 0);
    foreach ($companies as $c) {
        $cl_options[$c->name] = $c->id;
    }
    $tab->add(new Form_Dropdown('project_company', __('Company', 'form label'), $cl_options, $project->company));
    $tab->add(new Form_Dropdown('project_prio', "Prio", array_flip($g_prio_names), $project->prio));
    $tab->add($project->fields['projectpage']->getFormElement($project));
    $tab->add($project->fields['date_start']->getFormElement($project));
    $tab->add($project->fields['date_closed']->getFormElement($project));
    $tab_group->add($tab = new Page_Tab("description", __("Description")));
    $e = $project->fields['description']->getFormElement($project);
    $e->rows = 20;
    $tab->add($e);
    global $g_project_setting_names;
    $tab_group->add($tab = new Page_Tab("tab3", __("Display")));
    $tab->add($project->fields['short']->getFormElement($project));
    $tab->add($project->fields['status_summary']->getFormElement($project));
    $tab->add($project->fields['color']->getFormElement($project));
    $tab->add(new Form_checkbox('PROJECT_SETTING_ENABLE_TASKS', $g_project_setting_names[PROJECT_SETTING_ENABLE_TASKS], $project->settings & PROJECT_SETTING_ENABLE_TASKS));
    $tab->add(new Form_checkbox('PROJECT_SETTING_ENABLE_FILES', $g_project_setting_names[PROJECT_SETTING_ENABLE_FILES], $project->settings & PROJECT_SETTING_ENABLE_FILES));
    $tab->add(new Form_checkbox('PROJECT_SETTING_ENABLE_BUGS', $g_project_setting_names[PROJECT_SETTING_ENABLE_BUGS], $project->settings & PROJECT_SETTING_ENABLE_BUGS));
    $tab->add(new Form_checkbox('PROJECT_SETTING_ENABLE_EFFORTS', $g_project_setting_names[PROJECT_SETTING_ENABLE_EFFORTS], $project->settings & PROJECT_SETTING_ENABLE_EFFORTS));
    $tab->add(new Form_checkbox('PROJECT_SETTING_ENABLE_MILESTONES', $g_project_setting_names[PROJECT_SETTING_ENABLE_MILESTONES], $project->settings & PROJECT_SETTING_ENABLE_MILESTONES));
    $tab->add(new Form_checkbox('PROJECT_SETTING_ENABLE_VERSIONS', $g_project_setting_names[PROJECT_SETTING_ENABLE_VERSIONS], $project->settings & PROJECT_SETTING_ENABLE_VERSIONS));
    $tab->add(new Form_checkbox('PROJECT_SETTING_ENABLE_NEWS', $g_project_setting_names[PROJECT_SETTING_ENABLE_NEWS], $project->settings & PROJECT_SETTING_ENABLE_NEWS));
    ### create another one ###
    if ($auth->cur_user->user_rights & RIGHT_PROJECT_CREATE && $project->id == 0) {
        $checked = get('create_another') ? 'checked' : '';
        $form->form_options[] = "<span class=option><input name='create_another' class='checker' type=checkbox {$checked}>" . __("Create another project after submit") . "</span>";
    }
    #echo "<input type=hidden name='prj' value='$project->id'>";
    $form->add(new Form_Hiddenfield('prj', '', $project->id));
    echo $form;
    $block->render_blockEnd();
    $PH->go_submit = 'projEditSubmit';
    if ($return = get('return')) {
        echo "<input type=hidden name='return' value='{$return}'>";
    }
    echo new PageContentClose();
    echo new PageHtmlEnd();
}
开发者ID:Bremaweb,项目名称:streber-1,代码行数:80,代码来源:project_more.inc.php

示例13: getForQuery

 static function getForQuery($search_query, $project = NULL)
 {
     $count_overall = 0;
     $results = array();
     global $PH;
     require_once confGet('DIR_STREBER') . "db/class_company.inc.php";
     $args = array('order_str' => NULL, 'has_id' => NULL, 'search' => $search_query);
     foreach ($companies = Company::getAll($args) as $company) {
         $rate = RATE_TYPE_COMPANY;
         $rate *= SearchResult::RateItem($company);
         $rate *= SearchResult::RateTitle($company, $search_query);
         $results[] = new SearchResult(array('name' => $company->name, 'rating' => $rate, 'type' => __('Company'), 'jump_id' => 'companyView', 'jump_params' => array('company' => $company->id, 'q' => $search_query), 'item' => $company));
     }
     require_once confGet('DIR_STREBER') . "db/class_person.inc.php";
     foreach ($people = Person::getPeople(array('search' => $search_query)) as $person) {
         $rate = RATE_TYPE_PERSON;
         $rate *= SearchResult::RateItem($person);
         $rate *= SearchResult::RateTitle($person, $search_query);
         $results[] = new SearchResult(array('name' => $person->name, 'rating' => $rate, 'type' => __('Person'), 'jump_id' => 'personView', 'jump_params' => array('person' => $person->id, 'q' => $search_query), 'item' => $person));
     }
     require_once confGet('DIR_STREBER') . "db/class_project.inc.php";
     $projects = Project::getAll(array('status_min' => 0, 'status_max' => 10, 'search' => $search_query));
     if ($projects) {
         foreach ($projects as $project) {
             $rate = RATE_TYPE_PROJECT;
             if ($project->status == STATUS_TEMPLATE) {
                 $rate *= RATE_PROJECT_IS_TEMPLATE;
             } else {
                 if ($project->status < STATUS_COMPLETED) {
                     $rate *= RATE_PROJECT_IS_OPEN;
                 } else {
                     $rate *= RATE_PROJECT_IS_CLOSED;
                 }
             }
             if ($diz = SearchResult::getExtract($project, $search_query)) {
                 $rate *= RATE_IN_DETAILS;
             }
             ### status ###
             global $g_status_names;
             $status = isset($g_status_names[$project->status]) ? $g_status_names[$project->status] : '';
             if ($project->status > STATUS_COMPLETED) {
                 $rate *= RATE_TASK_STATUS_CLOSED;
             } else {
                 if ($project->status >= STATUS_COMPLETED) {
                     $rate *= RATE_TASK_STATUS_COMPLETED;
                 }
             }
             ### for company ###
             $html_location = '';
             if ($company = Company::getVisibleById($project->company)) {
                 $html_location = __('for') . ' ' . $company->getLink();
             }
             $rate *= SearchResult::RateItem($project);
             $rate *= SearchResult::RateTitle($project, $search_query);
             $results[] = new SearchResult(array('name' => $project->name, 'rating' => $rate, 'item' => $project, 'type' => __('Project'), 'jump_id' => 'projView', 'jump_params' => array('prj' => $project->id, 'q' => $search_query), 'extract' => $diz, 'status' => $status, 'html_location' => $html_location));
         }
     }
     require_once confGet('DIR_STREBER') . "db/class_task.inc.php";
     $order_str = get('sort_' . $PH->cur_page->id . "_tasks");
     $tasks = Task::getAll(array('order_by' => $order_str, 'search' => $search_query, 'status_min' => STATUS_UPCOMING, 'status_max' => STATUS_CLOSED));
     if ($tasks) {
         foreach ($tasks as $task) {
             $rate = RATE_TYPE_TASK;
             $rate *= SearchResult::RateItem($task);
             $rate *= SearchResult::RateTitle($task, $search_query);
             if ($task->category == TCATEGORY_FOLDER) {
                 $rate *= RATE_TASK_IS_FOLDER;
             }
             if ($diz = SearchResult::getExtract($task, $search_query)) {
                 $rate *= RATE_IN_DETAILS;
             }
             global $g_status_names;
             $status = isset($g_status_names[$task->status]) ? $g_status_names[$task->status] : '';
             if ($task->status > STATUS_COMPLETED) {
                 $rate *= RATE_TASK_STATUS_CLOSED;
             } else {
                 if ($task->status >= STATUS_COMPLETED) {
                     $rate *= RATE_TASK_STATUS_COMPLETED;
                 }
             }
             if ($project = Project::getVisibleById($task->project)) {
                 $prj = $project->getLink();
             } else {
                 $prj = '';
             }
             $html_location = __('in') . " <b>{$prj}</b> &gt; " . $task->getFolderLinks();
             $is_done = $task->status < STATUS_COMPLETED ? false : true;
             $results[] = new SearchResult(array('name' => $task->name, 'rating' => $rate, 'extract' => $diz, 'item' => $task, 'type' => $task->getLabel(), 'status' => $status, 'html_location' => $html_location, 'is_done' => $is_done, 'jump_id' => 'taskView', 'jump_params' => array('tsk' => $task->id, 'q' => $search_query)));
         }
     }
     require_once confGet('DIR_STREBER') . "db/class_comment.inc.php";
     $comments = Comment::getAll(array('search' => $search_query));
     if ($comments) {
         foreach ($comments as $comment) {
             $rate = RATE_TYPE_COMMENT;
             $rate *= SearchResult::RateItem($comment);
             $rate *= SearchResult::RateTitle($comment, $search_query);
             if ($diz = SearchResult::getExtract($comment, $search_query)) {
                 $rate *= RATE_IN_DETAILS;
             }
//.........这里部分代码省略.........
开发者ID:Bremaweb,项目名称:streber-1,代码行数:101,代码来源:search.inc.php


注:本文中的Company::getAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。