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


PHP Team::lookup方法代码示例

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


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

示例1: getStaffTeams

 function getStaffTeams($staff_id)
 {
     $sql = "select  * from " . TEAM_MEMBER_TABLE . " where staff_id=" . $staff_id;
     if (!($res = db_query($sql)) || !db_num_rows($res)) {
         return "";
     } else {
         $teams = "";
         while ($row = db_fetch_array($res)) {
             if ($team = Team::lookup(intval($row['team_id']))) {
                 if ($teamname = $team->getName()) {
                     $teams = $teams . stripslashes($teamname);
                 }
             }
         }
         return trim($teams);
     }
 }
开发者ID:KingsleyGU,项目名称:osticket,代码行数:17,代码来源:class.staff.php

示例2: chr

if($userInfoArray = Staff::getStaffCSVFile())
{
	// echo json_encode($userInfoArray);
	foreach ($userInfoArray as $fields) {
			// echo json_encode(array($fields['username'],$fields['firstname'],$fields['lastname'],$fields['isadmin'],$fields['onvacation'],$fields['created'],$fields['lastlogin'],Staff::getStaffTeams($fields['staff_id'])));
		fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF));
		// fputcsv($fp,$fields);
		$teams = Staff::getStaffTeams($fields['staff_id']);
		// logErrors(json_encode(Team::getActiveTeams()));
		// echo $teams;
		html_entity_decode(mb_convert_encoding(stripslashes($teams), "HTML-ENTITIES", 'UTF-8'));
		try {
			$resultArray = array($fields['username'],$fields['firstname'],$fields['lastname'],booleanToString($fields['isadmin']),$fields['created'],$fields['lastlogin']);
			foreach ($teamsArray as $key=>$value) {
				// logErrors("team id: ".$key);
				if($team = Team::lookup(intval($key)))
				{
					logErrors(json_encode($team->getName()));
					array_push($resultArray,booleanToString($team->hasMember(Staff::lookup(intval($fields['staff_id'])))));	
				}
			}
			// logErrors(json_encode($resultArray));
			fputcsv($fp,$resultArray);
	    // fputcsv($fp, array_merge(array($fields['username'],$fields['firstname'],$fields['lastname'],$fields['isadmin'],$fields['onvacation'],$fields['created'],$fields['lastlogin']),null));
		
		} catch (Exception $e) {
			logErrors('Caught exception: ',  $e->getMessage(), "\n");
		}
	}

}
开发者ID:KingsleyGU,项目名称:osticket,代码行数:31,代码来源:downloadUserInfoCSV.php

示例3: assignToTeam

 function assignToTeam($team, $note, $alert = true)
 {
     if (!is_object($team) && !($team = Team::lookup($team))) {
         return false;
     }
     if (!$this->setTeamId($team->getId())) {
         return false;
     }
     //Clear - staff if it's a closed ticket
     //  staff_id is overloaded -> assigned to & closed by.
     if ($this->isClosed()) {
         $this->setStaffId(0);
     }
     $this->onAssign($note, $alert);
     return true;
 }
开发者ID:ryan1432,项目名称:osTicket-1.7fork,代码行数:16,代码来源:class.ticket.php

示例4: IN

             break;
         case 'disable':
             $sql = 'UPDATE ' . TEAM_TABLE . ' SET isenabled=0 ' . ' WHERE team_id IN (' . implode(',', db_input($_POST['ids'])) . ')';
             if (db_query($sql) && ($num = db_affected_rows())) {
                 if ($num == $count) {
                     $msg = sprintf(__('Successfully disabled %s'), _N('selected team', 'selected teams', $count));
                 } else {
                     $warn = sprintf(__('%1$d of %2$d %3$s disabled'), $num, $count, _N('selected team', 'selected teams', $count));
                 }
             } else {
                 $errors['err'] = sprintf(__('Unable to disable %s'), _N('selected team', 'selected teams', $count));
             }
             break;
         case 'delete':
             foreach ($_POST['ids'] as $k => $v) {
                 if (($t = Team::lookup($v)) && $t->delete()) {
                     $i++;
                 }
             }
             if ($i && $i == $count) {
                 $msg = sprintf(__('Successfully deleted %s'), _N('selected team', 'selected teams', $count));
             } elseif ($i > 0) {
                 $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected team', 'selected teams', $count));
             } elseif (!$errors['err']) {
                 $errors['err'] = sprintf(__('Unable to delete %s'), _N('selected team', 'selected teams', $count));
             }
             break;
         default:
             $errors['err'] = __('Unknown action - get technical help.');
     }
 }
开发者ID:dmiguel92,项目名称:osTicket-1.8,代码行数:31,代码来源:teams.php

示例5: update

 function update($vars, &$errors)
 {
     $valid = true;
     $forms = $this->getForms($vars);
     foreach ($forms as $cd) {
         if (!$cd->isValid()) {
             $valid = false;
         }
         if ($cd->get('type') == 'O' && ($form = $cd->getForm($vars)) && ($f = $form->getField('name')) && $f->getClean() && ($o = Organization::lookup(array('name' => $f->getClean()))) && $o->id != $this->getId()) {
             $valid = false;
             $f->addError('Organization with the same name already exists');
         }
     }
     if ($vars['domain']) {
         foreach (explode(',', $vars['domain']) as $d) {
             if (!Validator::is_email('t@' . trim($d))) {
                 $errors['domain'] = 'Enter a valid email domain, like domain.com';
             }
         }
     }
     if ($vars['manager']) {
         switch ($vars['manager'][0]) {
             case 's':
                 if ($staff = Staff::lookup(substr($vars['manager'], 1))) {
                     break;
                 }
             case 't':
                 if ($vars['manager'][0] == 't' && ($team = Team::lookup(substr($vars['manager'], 1)))) {
                     break;
                 }
             default:
                 $errors['manager'] = 'Select a staff member or team from the list';
         }
     }
     if (!$valid || $errors) {
         return false;
     }
     foreach ($this->getDynamicData() as $cd) {
         if (($f = $cd->getForm()) && $f->get('type') == 'O' && ($name = $f->getField('name'))) {
             $this->name = $name->getClean();
             $this->save();
         }
         $cd->save();
     }
     // Set flags
     foreach (array('collab-all-flag' => Organization::COLLAB_ALL_MEMBERS, 'collab-pc-flag' => Organization::COLLAB_PRIMARY_CONTACT, 'assign-am-flag' => Organization::ASSIGN_AGENT_MANAGER) as $ck => $flag) {
         if ($vars[$ck]) {
             $this->setStatus($flag);
         } else {
             $this->clearStatus($flag);
         }
     }
     // Set staff and primary contacts
     $this->set('domain', $vars['domain']);
     $this->set('manager', $vars['manager'] ?: '');
     if ($vars['contacts'] && is_array($vars['contacts'])) {
         foreach ($this->allMembers() as $u) {
             $u->setPrimaryContact(array_search($u->id, $vars['contacts']) !== false);
             $u->save();
         }
     }
     return $this->save();
 }
开发者ID:ed00m,项目名称:osTicket-1.8,代码行数:63,代码来源:class.organization.php


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