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


PHP Department::getInstance方法代码示例

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


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

示例1: NewTicket

 public function NewTicket($subject, $message, $depid, $creatorid, $userid)
 {
     if (strlen($subject) < 3 || strlen($subject) > 255) {
         throw new Exception("ticket's subject too long or too short");
     }
     if (!is_numeric($depid) || !is_numeric($creatorid) || !is_numeric($userid)) {
         throw new Exception("department, creator or user id in wrong format");
     }
     $user = User::getInstance();
     $dep = Department::getInstance();
     $depdata = $dep->FetchData($depid);
     $crdata = $user->FetchData($creatorid);
     $userdata = $user->FetchData($userid);
     if ($userdata['status'] == 'Admin') {
         throw new Exception("Ticket cannot be created for admin");
     } elseif ($depdata['type'] == 'Private') {
         throw new Exception("Users cannot submit tickets to private deprtments");
     }
     $ticket = Ticket::getInstance();
     $tid = $ticket->Create(array('depid' => $depid, 'subject' => $subject, 'userid' => $userid));
     $this->Create($tid, $creatorid, $message);
     return $tid;
 }
开发者ID:carriercomm,项目名称:Multicabinet,代码行数:23,代码来源:class.TicketChange.php

示例2: SmartyClass

require_once '../classes/class.smartyclass.php';
$TML = new SmartyClass();
$operator = Operator::getInstance()->GetLoggedOperator();
$threadid = verify_param("thread", "/^\\d{1,8}\$/");
$token = verify_param("token", "/^\\d{1,8}\$/");
$thread = Thread::getInstance()->GetThreadById($threadid);
$visitSession = VisitSession::GetInstance()->GetVisitSessionById($thread['visitsessionid']);
$TML->assign('visit_session', $visitSession);
if (!$thread || !isset($thread['token']) || $token != $thread['token']) {
    die("wrong thread");
}
$nextid = verify_param("nextoperatorid", "/^\\d{1,8}\$/");
$nextdepartmentid = verify_param("nextdepartmentid", "/^\\d{1,8}\$/");
$page = array();
if (!empty($nextid)) {
    $nextOperator = Operator::getInstance()->GetOperatorById($nextid);
    $TML->assign('nextoperator', $nextOperator);
}
if (!empty($nextdepartmentid)) {
    $nextdepartment = Department::getInstance()->getById($nextdepartmentid, Resources::getCurrentLocale());
    $TML->assign('nextdepartment', $nextdepartment);
}
$errors = array();
ThreadProcessor::getInstance()->ProcessThread($threadid, 'redirect', array('nextoperatorid' => $nextid, 'nextdepartmentid' => $nextdepartmentid, 'operator' => Operator::getInstance()->GetLoggedOperator()));
$TML->assign('page_settings', $page);
if (count($errors) > 0) {
    $TML->assign('errors', $errors);
    $TML->display('chat_error.tpl');
} else {
    $TML->display('redirected.tpl');
}
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:31,代码来源:redirect.php

示例3: UserAddTicket

 public static function UserAddTicket()
 {
     $xtpl = self::$xtpl;
     $dep = Department::getInstance();
     $xtpl->assign('SUPPCURR', 'current');
     $xtpl->assign('NEWTCURR', 'current');
     $deps = $dep->GetButch("", '`type` = "Public"');
     if (count($deps) < 1) {
         $xtpl->parse('main.addticket.depinfo');
     } else {
         for ($i = 0; $i < count($deps); $i++) {
             $xtpl->assign('DEP', $deps[$i]);
             $xtpl->parse('main.addticket.ticket.deprow');
         }
         $xtpl->parse('main.addticket.ticket');
     }
     $xtpl->parse('main.addticket');
     $xtpl->parse('main');
     $xtpl->out('main');
 }
开发者ID:carriercomm,项目名称:Multicabinet,代码行数:20,代码来源:class.Page.php

示例4: deleteDepartment

function deleteDepartment()
{
    Department::getInstance()->deleteDepartment($_REQUEST['id']);
    header("Location: " . AdminURL::getInstance()->getURL('departments'));
    exit;
}
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:6,代码来源:department.php

示例5: array

 case 'delcurr':
     $curr = Currency::getInstance();
     $curr->Delete($_REQUEST['id']);
     Page::ManageCurrencies();
     break;
 case 'delorder':
     if (!is_numeric($_REQUEST['orderid'])) {
         Page::$messages[] = array('type' => 'attention', 'message' => 'Order ID is not set');
     } else {
         $order = Order::getInstance();
         $order->Delete($_REQUEST['orderid']);
         Page::ManageOrders();
     }
     break;
 case 'updatedep':
     $dep = Department::getInstance();
     $dep->id = $_POST['depid'];
     $dep->Update('name', $_POST['depname']);
     $dep->Update('type', $_POST['type']);
     Page::ManageDepartments();
     break;
 case 'updatelangs':
     $lang = Lang::getInstance();
     $lang->UpdateLangs();
     Page::GeneralSettings();
     break;
 case 'updatelang':
     $setting = Settings::getInstance();
     $setting->Update('system.lang.default', $_POST['langcode']);
     Page::GeneralSettings();
     break;
开发者ID:carriercomm,项目名称:Multicabinet,代码行数:31,代码来源:index.php


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