• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Prefs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: validateCredentials

 /**
  * Used to vaidate a user's credentials. (uname, pass)
  * @param	array	$creds	the uname and password passed in as an array.
  * @return 	bool
  */
 function validateCredentials($creds)
 {
     $pwent = posix_getpwnam(strtolower($creds['uname']));
     if ($pwent == false) {
         API::Error("Invalid Username/Password");
     }
     $cryptpw = crypt($creds['password'], $pwent['passwd']);
     if ($cryptpw == $pwent['passwd']) {
         API::DEBUG("[Auth_NIS::validateCredentials] returning TRUE", 8);
         $_SESSION['authed_user'] = $pwent['uid'];
         $this->authed_user = $pwent['uid'];
         $names = explode(" ", $pwent['gecos'], 2);
         $names['fname'] = $names[0];
         $names['lname'] = $names[1];
         unset($names[1]);
         unset($names[0]);
         $prefs = new Prefs();
         if ($prefs->checkUID($this->authed_user, $this->config->prefs_auto, NULL, $names)) {
             return TRUE;
         } else {
             API::Error("Username Not Valid in system. Error: 3304");
         }
     }
     return FALSE;
 }
开发者ID:uberlinuxguy,项目名称:certis,代码行数:30,代码来源:Auth_NIS.model.php


示例2: getIndex

 public function getIndex()
 {
     $categories = Prefs::getCategory()->catToSelection('title', 'title');
     $this->heads = array(array('Title', array('search' => true, 'sort' => true)), array('Creator', array('search' => true, 'sort' => false)), array('Category', array('search' => true, 'select' => $categories, 'sort' => true)), array('Tags', array('search' => true, 'sort' => true)), array('Created', array('search' => true, 'sort' => true, 'date' => true)), array('Last Update', array('search' => true, 'sort' => true, 'date' => true)));
     //print $this->model->where('docFormat','picture')->get()->toJSON();
     return parent::getIndex();
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:7,代码来源:TemplateController.php


示例3: getInstance

 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new Prefs();
     }
     return self::$instance;
 }
开发者ID:jelek92,项目名称:lpStore,代码行数:7,代码来源:Prefs.php


示例4: _createContent

 /**
  * Commentaires d'une procedure
  *
  * @author Christophe Beyer <[email protected]>
  * @since 2008/01/30
  * @param object $rFiche Recordset de la procedure
  */
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $rFiche = $this->getParam('rFiche');
     $mondroit = $this->getParam('mondroit');
     $daoinfo =& _dao('infosupp');
     $sql = 'SELECT * FROM module_teleprocedure_infosupp WHERE idinter=' . $rFiche->idinter . '';
     $canCheckVisible = TeleproceduresService::canMakeInTelep('CHECK_VISIBLE', $mondroit);
     $canAddComment = TeleproceduresService::canMakeInTelep('ADD_COMMENT', $mondroit);
     if (!$canCheckVisible) {
         $sql .= " AND info_message!='' AND info_message IS NOT NULL";
     }
     $sql .= " ORDER BY dateinfo ASC, idinfo ASC";
     $results = _doQuery($sql);
     // Pour chaque message on cherche les infos de son auteur
     $list = array();
     foreach ($results as $r) {
         $userInfo = Kernel::getUserInfo("ID", $r->iduser);
         //var_dump($userInfo);
         $avatar = Prefs::get('prefs', 'avatar', $r->iduser);
         $userInfo['avatar'] = $avatar ? CopixConfig::get('prefs|avatar_path') . $avatar : '';
         $r->user = $userInfo;
         $list[] = $r;
     }
     //print_r($rFiche);
     $tpl->assign('info_message_edition', CopixZone::process('kernel|edition', array('field' => 'info_message', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
     $tpl->assign('info_commentaire_edition', CopixZone::process('kernel|edition', array('field' => 'info_commentaire', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
     $tpl->assign('canCheckVisible', $canCheckVisible);
     $tpl->assign('canAddComment', $canAddComment);
     $tpl->assign('list', $list);
     $tpl->assign('rFiche', $rFiche);
     $toReturn = $tpl->fetch('fiche-comms-zone.tpl');
     return true;
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:41,代码来源:fichecomms.zone.php


示例5: actionVersion

 public function actionVersion()
 {
     if (isset($_POST['version'])) {
         Yii::app()->end(Prefs::getVersion());
     }
     Yii::app()->end('1');
 }
开发者ID:DmitriyS,项目名称:CS-Bans,代码行数:7,代码来源:AdminController.php


示例6: getIndex

 public function getIndex()
 {
     $this->heads = array(array('Role', array('search' => true, 'sort' => false, 'select' => Prefs::getRole()->RoleToSelection('_id', 'rolename'))), array('Created', array('search' => true, 'sort' => true, 'date' => true)), array('Last Update', array('search' => true, 'sort' => true, 'date' => true)));
     //print $this->model->where('docFormat','picture')->get()->toJSON();
     Breadcrumbs::addCrumb('System', URL::to(strtolower($this->controller_name)));
     return parent::getIndex();
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:7,代码来源:UsergroupController.php


示例7: getIndex

 public function getIndex()
 {
     $this->heads = array(array('Full Name', array('search' => true, 'sort' => true)), array('Role', array('search' => true, 'sort' => false, 'select' => Prefs::getRole()->RoleToSelection('_id', 'rolename'))), array('Email', array('search' => true, 'sort' => true)), array('Mobile', array('search' => true, 'sort' => true)), array('Address', array('search' => true, 'sort' => true)), array('Created', array('search' => true, 'sort' => true, 'date' => true)), array('Last Update', array('search' => true, 'sort' => true, 'date' => true)));
     $this->title = 'Employees';
     $this->place_action = 'first';
     Breadcrumbs::addCrumb('HRMS', URL::to(strtolower($this->controller_name)));
     return parent::getIndex();
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:8,代码来源:EmployeeController.php


示例8: getIndex

 public function getIndex()
 {
     $categories = Prefs::getCategory()->catToSelection('title', 'title');
     $this->heads = array(array('Title', array('search' => true, 'sort' => true)), array('Status', array('search' => true, 'sort' => true)), array('Creator', array('search' => true, 'sort' => false)), array('Category', array('search' => true, 'select' => $categories, 'sort' => true)), array('Tags', array('search' => true, 'sort' => true)), array('Created', array('search' => true, 'sort' => true, 'date' => true)), array('Last Update', array('search' => true, 'sort' => true, 'date' => true)));
     //print $this->model->where('docFormat','picture')->get()->toJSON();
     $this->modal_sets = View::make(strtolower($this->controller_name) . '.modal')->render();
     $this->js_table_event = View::make(strtolower($this->controller_name) . '.jsevent')->render();
     return parent::getIndex();
 }
开发者ID:awidarto,项目名称:tmadminflat,代码行数:9,代码来源:BrochureController.php


示例9: getIndex

 public function getIndex()
 {
     $this->heads = array(array('Full Name', array('search' => true, 'sort' => true)), array('Role', array('search' => true, 'sort' => false, 'select' => Prefs::getRole()->RoleToSelection('_id', 'rolename'))), array('Email', array('search' => true, 'sort' => true)), array('Mobile', array('search' => true, 'sort' => true)), array('Address', array('search' => true, 'sort' => true)), array('Created', array('search' => true, 'sort' => true, 'date' => true)), array('Last Update', array('search' => true, 'sort' => true, 'date' => true)));
     $this->title = 'Users';
     $this->place_action = 'first';
     Breadcrumbs::addCrumb('Profile', URL::to(strtolower($this->controller_name)));
     //return parent::getIndex();
     $bt_edit = '<a href="' . URL::to('profile/edit/' . Auth::user()->_id) . '" class="btn btn-sm btn-primary btn-transparent"><i class="fa fa-edit"></i> Edit</a>';
     return View::make('profile.index')->with('title', Auth::user()->fullname . ' ' . $bt_edit);
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:10,代码来源:ProfileController.php


示例10: sendMinimail

 /**
  * Envoie un minimail
  *
  * @author Christophe Beyer <[email protected]>
  * @since 2005/10/18
  * @param string title Titre du minimail
  * @param string message Corps du minimail
  * @param integer from_id Id utilisateur de l'exp�diteur
  * @param array destin Id tableau avec les destinataires (cl� = id user)
  * @return mixed Id du message cr�� ou NULL si erreur
  */
 public function sendMinimail($title, $message, $from_id, $destin, $format)
 {
     $res = NULL;
     $DAOminimail_from = _dao("minimail|minimail_from");
     $DAOminimail_to = _dao("minimail|minimail_to");
     $newMp = _record("minimail|minimail_from");
     $newMp->title = $title;
     $newMp->message = $message;
     $newMp->format = $format;
     $newMp->date_send = date("Y-m-d H:i:s");
     $newMp->from_id = $from_id;
     $newMp->is_deleted = 0;
     $DAOminimail_from->insert($newMp);
     if ($newMp->id !== NULL) {
         //print_r($newMp);
         // On parcourt chaque destinataire
         while (list($to_id, ) = each($destin)) {
             // print_r("to_id=$to_id / to_login=$to_login");
             $newDest = _record("minimail|minimail_to");
             $newDest->id_message = $newMp->id;
             $newDest->to_id = $to_id;
             $newDest->date_read = 0;
             $newDest->is_read = 0;
             $newDest->is_replied = 0;
             $newDest->is_deleted = 0;
             $DAOminimail_to->insert($newDest);
             // ======= Alerte mail ===============
             // On vérifie que l'envoi de mails est activé, qu'un serveur SMTP est configuré, que le destinataire a coché l'option "etre prêvenu par mail" et qu'il a renseigné un mail
             if ($newDest->id2 && CopixConfig::get('|mailEnabled') == 1 && CopixConfig::get('|mailSmtpHost')) {
                 $prefs = Prefs::getPrefs($to_id);
                 if (isset($prefs['prefs']['alerte_mail_email']) && isset($prefs['minimail']['alerte_minimail']) && $prefs['prefs']['alerte_mail_email'] && $prefs['minimail']['alerte_minimail'] == 1) {
                     $userInfoFrom = Kernel::getUserInfo("ID", $from_id);
                     //print_r($userInfoFrom);
                     $to = $prefs['prefs']['alerte_mail_email'];
                     $auteur = utf8_decode($userInfoFrom['prenom'] . ' ' . $userInfoFrom['nom'] . ' (' . $userInfoFrom['login'] . ')');
                     $subject = CopixI18N::get('minimail|minimail.mail.alert.subject', array($auteur));
                     $message = str_replace('<br />', "\n", CopixI18N::get('minimail|minimail.mail.alert.body', array($auteur, CopixUrl::get('minimail||getMessage', array('id' => $newMp->id)), CopixUrl::get())));
                     $from = CopixConfig::get('default|mailFrom');
                     $fromName = CopixConfig::get('default|mailFromName');
                     $cc = $cci = '';
                     $monMail = new CopixTextEMail($to, $cc, $cci, $subject, $message);
                     $send = $monMail->send($from, $fromName);
                 }
             }
             // ======= Fin alerte mail ===============
         }
         $res = $newMp->id;
         if ($res) {
             $plugStats = CopixPluginRegistry::get("stats|stats");
             $plugStats->setParams(array('module' => 'minimail', 'action' => 'sendMinimail', 'objet_a' => $res));
         }
     }
     return $res;
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:65,代码来源:minimailservice.class.php


示例11: afterSave

 public function afterSave($data)
 {
     //print_r($data);
     //exit();
     if ($data['sendOption'] == 'immediately') {
         //make queue id
         $qid = Prefs::makeQueueId();
         $qdate = new MongoDate();
         $cid = $data['_id']->toString();
         $cmp = Campaign::find($cid);
         $cmp->push(array('queueId' => $qid, 'queueInitTime' => $qdate));
         $cmp->save();
         //put into queue
         //set history
     } else {
     }
     return $data;
 }
开发者ID:awidarto,项目名称:tmadminflat,代码行数:18,代码来源:CampaignController.php


示例12: _createContent

 /**
  * Affiche la fiche détaillée d'un utilisateur (login, nom, prénom...)
  *
  * @author Christophe Beyer <[email protected]>
  * @since 2006/01/04
  * @param string $type Type de personne (USER_ELE, USER_ELE...)
  * @param integer $id Id
  */
 public function _createContent(&$toReturn)
 {
     $annuaireService =& CopixClassesFactory::Create('annuaire|AnnuaireService');
     $type = $this->getParam('type') ? $this->getParam('type') : NULL;
     $id = $this->getParam('id') ? $this->getParam('id') : NULL;
     $canWrite = $canView = false;
     if ($type && $id) {
         $usr = Kernel::getUserInfo($type, $id);
         $usr['type_nom'] = Kernel::Code2Name($usr['type']);
         //Kernel::myDebug($usr);
         $droits = Kernel::getUserInfoMatrix($usr);
         $canView = $droits['voir'];
         $canWrite = $droits['communiquer'];
         if ($canView) {
             // Avatar
             $avatar = '';
             if (isset($usr['user_id'])) {
                 $avatar = Prefs::get('prefs', 'avatar', $usr['user_id']);
             }
             $usr['avatar'] = $avatar ? CopixConfig::get('prefs|avatar_path') . $avatar : '';
             $parents = $enfants = array();
             if ($type == 'USER_ELE') {
                 // Pour un élève, on cherche ses parents
                 $parents = $annuaireService->getParentsFromEleve($id);
             } elseif ($type == 'USER_RES') {
                 // Pour un parent, on cherche ses enfants
                 $enfants = $annuaireService->getEnfantsFromParent($id);
             }
         } else {
             $usr = $parents = $enfants = false;
         }
         $tpl = new CopixTpl();
         $tpl->assign('usr', $usr);
         $tpl->assign('canWrite', $canWrite);
         $tpl->assign('parents', $parents);
         $tpl->assign('enfants', $enfants);
         $toReturn = $tpl->fetch('getuserprofilzone.tpl');
     }
     return true;
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:48,代码来源:getuserprofil.zone.php


示例13: updateStock

 public static function updateStock($data, $positive = 'available', $negative = 'deleted')
 {
     //print_r($data);
     $outlets = $data['outlets'];
     $outletNames = $data['outletNames'];
     $addQty = $data['addQty'];
     $adjustQty = $data['adjustQty'];
     unset($data['outlets']);
     unset($data['outletNames']);
     unset($data['addQty']);
     unset($data['adjustQty']);
     $productDetail = Product::find($data['id'])->toArray();
     // year and month used fro batchnumber
     $year = date('Y', time());
     $month = date('m', time());
     for ($i = 0; $i < count($outlets); $i++) {
         $su = array('outletId' => $outlets[$i], 'outletName' => $outletNames[$i], 'productId' => $data['id'], 'SKU' => $data['SKU'], 'productDetail' => $productDetail, 'status' => $positive, 'createdDate' => new MongoDate(), 'lastUpdate' => new MongoDate());
         if ($addQty[$i] > 0) {
             for ($a = 0; $a < $addQty[$i]; $a++) {
                 $su['_id'] = str_random(8);
                 $batchnumber = Prefs::GetBatchId($data['SKU'], $year, $month);
                 $su['_id'] = $data['SKU'] . '|' . $batchnumber;
                 $history = array('datetime' => new MongoDate(), 'action' => 'init', 'price' => $productDetail['priceRegular'], 'status' => $su['status'], 'outletName' => $su['outletName']);
                 $su['history'] = array($history);
                 Stockunit::insert($su);
             }
         }
         if ($adjustQty[$i] > 0) {
             $td = Stockunit::where('outletId', $outlets[$i])->where('productId', $data['id'])->where('SKU', $data['SKU'])->where('status', 'available')->orderBy('createdDate', 'asc')->take($adjustQty[$i])->get();
             foreach ($td as $d) {
                 $d->status = $negative;
                 $d->lastUpdate = new MongoDate();
                 $d->save();
                 $history = array('datetime' => new MongoDate(), 'action' => 'delete', 'price' => $d->priceRegular, 'status' => $d->status, 'outletName' => $d->outletName);
                 $d->push('history', $history);
             }
         }
     }
 }
开发者ID:awidarto,项目名称:tmadminflat,代码行数:39,代码来源:Commerce.php


示例14: execute

 function execute()
 {
     if (Config::lpStoreRedis) {
         $key = get_class() . ':' . $this->typeID . ',' . $this->qty;
         $cache = json_decode($this->bpcCache->get($key), true);
         if (empty($cache) || empty($cache['manDetails']) || $cache['version'] != Db::$dbName) {
             $cache = array('version' => Db::$dbName, 'manDetails' => $this->performQuery());
             $this->bpcCache->set($key, json_encode($cache));
         }
     } else {
         $cache = array('version' => Db::$dbName, 'manDetails' => $this->performQuery());
     }
     # set price info for manufacturing materials
     foreach ($cache['manDetails'] as &$manItem) {
         try {
             $price = new Price(Emdr::get($manItem['typeID']));
             $manItem['price'] = $price->{Prefs::get('marketMat')}[0];
             $manItem['totPrice'] = $manItem['price'] * $manItem['totQty'];
         } catch (Exception $e) {
             array_push($this->noCache, $manItem['typeName']);
         }
     }
     return $cache['manDetails'];
 }
开发者ID:jelek92,项目名称:lpStore,代码行数:24,代码来源:OfferMaterials.php


示例15: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $logistic_id = 'CGKN00027';
     $logistic = Logistic::where('consignee_olshop_cust', '=', $logistic_id)->first();
     if (Prefs::isRunning($this->name)) {
         $l = array();
         $l['ts'] = new MongoDate();
         $l['error'] = 'process already running';
         $l['consignee_logistic_id'] = $logistic->logistic_code;
         $l['consignee_olshop_cust'] = $logistic_id;
         Threeplstatuserror::insert($l);
         die('process already running');
     }
     $orders = Shipment::where('awb', '!=', '')->where('bucket', '=', Config::get('jayon.bucket_tracker'))->where(function ($sq) {
         $sq->where('status', '!=', 'delivered')->where('status', '!=', 'undelivered')->where('status', '!=', 'canceled')->where('status', '!=', 'returned');
     })->where('logistic_type', '=', 'external')->where('consignee_olshop_cust', '=', $logistic_id)->get();
     $res = array();
     print 'count ' . count($orders->toArray());
     if ($orders && count($orders->toArray()) > 0) {
         $req = array();
         foreach ($orders as $ord) {
             //$req[] = array('order_id'=>$ord->no_sales_order.'-'.$ord->consignee_olshop_orderid,'awb'=>$ord->awb);
             $req[] = array('order_id' => $ord->consignee_olshop_orderid, 'awb' => $ord->consignee_olshop_orderid);
         }
         $client = new GuzzleClient();
         //TO DO : Send data in chunk
         $reqchunks = array_chunk($req, 100);
         foreach ($reqchunks as $rq) {
             $this->sendData($rq, $client, $logistic, $logistic_id);
         }
     } else {
         print 'Empty order list' . "\r\n";
     }
     $actor = $this->name;
     Event::fire('log.api', array('JayaStatusDaemon', 'get', $actor, 'JAYA STATUS PULL'));
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:41,代码来源:JayaStatusDaemon.php


示例16: dirname

// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <[email protected]>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('self_assign.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$usr_id = Auth::getUserID();
$prj_id = Auth::getCurrentProject();
$issue_id = $_REQUEST['iss_id'];
$tpl->assign('issue_id', $issue_id);
// check if issue is assigned to someone else and if so, confirm change.
$assigned_user_ids = Issue::getAssignedUserIDs($issue_id);
if (count($assigned_user_ids) > 0 && empty($_REQUEST['target'])) {
    $tpl->assign(array('prompt_override' => 1, 'assigned_users' => Issue::getAssignedUsers($issue_id)));
} else {
    $issue_details = Issue::getDetails($issue_id);
    // force assignment change
    if (@$_REQUEST['target'] == 'replace') {
        // remove current user(s) first
        Issue::deleteUserAssociations($issue_id, $usr_id);
    }
    $res = Issue::addUserAssociation($usr_id, $issue_id, $usr_id);
    $tpl->assign('self_assign_result', $res);
    Notification::subscribeUser($usr_id, $issue_id, $usr_id, Notification::getDefaultActions($issue_id, User::getEmail($usr_id), 'self_assign'));
    Workflow::handleAssignmentChange($prj_id, $issue_id, $usr_id, $issue_details, Issue::getAssignedUserIDs($issue_id), false);
}
$tpl->assign('current_user_prefs', Prefs::get($usr_id));
$tpl->displayTemplate();
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:self_assign.php


示例17: dirname

// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: Bryan Alsdorf <[email protected]>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('reports/workload_time_period.tpl.html');
Auth::checkAuthentication(APP_COOKIE);
$usr_id = Auth::getUserID();
if (!Access::canAccessReports(Auth::getUserID())) {
    echo 'Invalid role';
    exit;
}
$prj_id = Auth::getCurrentProject();
// get timezone of current user
$user_prefs = Prefs::get($usr_id);
if (@$_GET['type'] == 'email') {
    $data = Report::getEmailWorkloadByTimePeriod(@$user_prefs['timezone']);
} else {
    $data = Report::getWorkloadByTimePeriod(@$user_prefs['timezone']);
}
$tpl->assign(array('data' => $data, 'type' => @$_GET['type'], 'user_tz' => Date_Helper::getTimezoneShortNameByUser($usr_id)));
$tpl->displayTemplate();
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:workload_time_period.php


示例18:

    <div class="span4">
		<table class="items table table-bordered table-condensed">
			<thead>
				<tr>
					<th>Статистика</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd">
					<td>
						<div class="pull-left muted">
							<b>Размер базы данных</b>
						</div>
						<div class="pull-right">
							<?php 
echo Prefs::db_size();
?>
						</div>
					</td>
				</tr>
				<tr class="odd">
					<td>
						<div class="pull-left muted">
							<b>Банов в истории</b>
						</div>
						<div class="pull-right">
							<?php 
echo $sysinfo['bancount'];
?>
						</div>
					</td>
开发者ID:DmitriyS,项目名称:CS-Bans,代码行数:31,代码来源:index.php


示例19: catch

            $email_details = Support::getEmailDetails(Email_Account::getAccountByEmail($item[0]), $item[0]);
            $tpl->assign(array('issue_summary' => $email_details['sup_subject'], 'issue_description' => $email_details['seb_body']));
            // also auto pre-fill the customer contact text fields
            if (CRM::hasCustomerIntegration($prj_id)) {
                $sender_email = Mail_Helper::getEmailAddress($email_details['sup_from']);
                try {
                    $contact = $crm->getContactByEmail($sender_email);
                    $tpl->assign('contact_details', $contact->getDetails());
                } catch (CRMException $e) {
                }
            }
        }
    }
}
$tpl->assign(array('cats' => Category::getAssocList($prj_id), 'priorities' => Priority::getAssocList($prj_id), 'severities' => Severity::getList($prj_id), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'releases' => Release::getAssocList($prj_id), 'custom_fields' => Custom_Field::getListByProject($prj_id, 'report_form'), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'max_attachment_bytes' => Attachment::getMaxAttachmentSize(true), 'field_display_settings' => Project::getFieldDisplaySettings($prj_id), 'groups' => Group::getAssocList($prj_id), 'products' => Product::getList(false)));
$prefs = Prefs::get($usr_id);
$tpl->assign('user_prefs', $prefs);
$tpl->assign('zones', Date_Helper::getTimezoneList());
if (Auth::getCurrentRole() == User::getRoleID('Customer')) {
    $crm = CRM::getInstance(Auth::getCurrentProject());
    $customer_contact_id = User::getCustomerContactID($usr_id);
    $contact = $crm->getContact($customer_contact_id);
    $customer_id = Auth::getCurrentCustomerID();
    $customer = $crm->getCustomer($customer_id);
    // TODOCRM: Pull contacts via ajax when user selects contract
    $tpl->assign(array('customer_id' => $customer_id, 'contact_id' => $customer_contact_id, 'customer' => $customer, 'contact' => $contact));
}
$clone_iss_id = isset($_GET['clone_iss_id']) ? (int) $_GET['clone_iss_id'] : null;
if ($clone_iss_id && Access::canCloneIssue($clone_iss_id, $usr_id)) {
    $tpl->assign(Issue::getCloneIssueTemplateVariables($clone_iss_id));
} else {
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:new.php


示例20: get

 /**
  * Method used to get the preferences set by a specific user.
  *
  * @param integer $usr_id The user ID
  * @param bool $force Set to true to force database refresh
  * @return array The preferences
  */
 public static function get($usr_id, $force = false)
 {
     static $returns;
     if (!$force && !empty($returns[$usr_id])) {
         return $returns[$usr_id];
     }
     $sql = 'SELECT
                 upr_timezone as timezone,
                 upr_week_firstday as week_firstday,
                 upr_list_refresh_rate as list_refresh_rate,
                 upr_email_refresh_rate as email_refresh_rate,
                 upr_email_signature as email_signature,
                 upr_auto_append_email_sig as auto_append_email_sig,
                 upr_auto_append_note_sig as auto_append_note_sig,
                 upr_auto_close_popup_window as close_popup_windows
             FROM
                 {{%user_preference}}
             WHERE
                 upr_usr_id=?';
     try {
         $res = DB_Helper::getInstance()->getRow($sql, array($usr_id));
     } catch (DbException $e) {
         return Prefs::getDefaults(array_keys(Project::getAssocList($usr_id, false, true)));
     }
     if ($res === null) {
         return Prefs::getDefaults(array_keys(Project::getAssocList($usr_id, false, true)));
     }
     $returns[$usr_id] = $res;
     $returns[$usr_id]['receive_assigned_email'] = array();
     $returns[$usr_id]['receive_new_issue_email'] = array();
     $returns[$usr_id]['receive_copy_of_own_action'] = array();
     // check for the refresh rate variables, and use the default values if appropriate
     if (empty($returns[$usr_id]['list_refresh_rate'])) {
         $returns[$usr_id]['list_refresh_rate'] = APP_DEFAULT_REFRESH_RATE;
     }
     if (empty($returns[$usr_id]['email_refresh_rate'])) {
         $returns[$usr_id]['email_refresh_rate'] = APP_DEFAULT_REFRESH_RATE;
     }
     // get per project preferences
     $sql = "SELECT\n                    upp_prj_id as prj_id,\n                    upp_receive_assigned_email as receive_assigned_email,\n                    upp_receive_new_issue_email as receive_new_issue_email,\n                    upp_receive_copy_of_own_action as receive_copy_of_own_action\n                FROM\n                    {{%user_project_preference}}\n                WHERE\n                    upp_usr_id = {$usr_id}";
     try {
         $res = DB_Helper::getInstance()->fetchAssoc($sql, array(), DB_FETCHMODE_ASSOC);
     } catch (DbException $e) {
         return $returns[$usr_id];
     }
     foreach ($res as $prj_id => $project_prefs) {
         $returns[$usr_id]['receive_assigned_email'][$prj_id] = $project_prefs['receive_assigned_email'];
         $returns[$usr_id]['receive_new_issue_email'][$prj_id] = $project_prefs['receive_new_issue_email'];
         $returns[$usr_id]['receive_copy_of_own_action'][$prj_id] = $project_prefs['receive_copy_of_own_action'];
     }
     return $returns[$usr_id];
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:59,代码来源:class.prefs.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Presenter类代码示例发布时间:2022-05-23
下一篇:
PHP Preferences类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap