コード例 #1
0
 public function actionTrash($ajax = null)
 {
     // auth manager
     if (!$this->module->authManager && (!$this->module->trashbox || $this->module->readOnly && !$this->module->isAdmin())) {
         $this->redirect(array('message/inbox'));
     }
     $this->module->registerConfig($this->getAction()->getId());
     $this->module->getClientScript()->registerScriptFile($this->module->getAssetsUrl() . '/js/jquery.colors.js');
     $this->module->getClientScript()->registerScriptFile($this->module->getAssetsUrl() . '/js/mailbox.js', CClientScript::POS_END);
     if (isset($_POST['convs'])) {
         $this->buttonAction('trash', 'trash');
     }
     $period =& $this->module->recyclePeriod;
     Yii::app()->user->setFlash('notice', "Messages in the trash are deleted within {$period} days.");
     $dataProvider = new CActiveDataProvider(Mailbox::model()->trash($this->module->getUserId()));
     if (isset($ajax)) {
         $this->renderPartial('_mailbox', array('dataProvider' => $dataProvider));
     } else {
         $this->render('mailbox', array('dataProvider' => $dataProvider));
     }
 }
コード例 #2
0
 public function cron()
 {
     $deleted_convs = Mailbox::model()->deleted()->findAll();
     foreach ($deleted_convs as $conv) {
         $conv->recycle();
     }
 }
コード例 #3
0
ファイル: Domain.php プロジェクト: ajaboa/crmpuan
 public function getSumMailboxes()
 {
     $record = Mailbox::model()->find(\GO\Base\Db\FindParams::newInstance()->single()->select('COUNT(*) AS count')->criteria(\GO\Base\Db\FindCriteria::newInstance()->addCondition('domain_id', $this->id)));
     return $record->count;
 }
コード例 #4
0
ファイル: header.php プロジェクト: rinodung/EduSec3.0.0
                <div class="header-right">
                	<div class="nav">
                      <ul class="nav-list">
                        <li><a href="#" class="nav-link orange"><i class="fa fa-bell"></i> <span class="nav-counter nav-counter-green">4</span></a></li>
                      <?php 
		    $empsession = 0;
		    $studsession = 0;
		    $count = 0;
		    if(!Yii::app()->user->isGuest){
		      $studsession = Yii::app()->user->getState('stud_id');
		      $empsession = Yii::app()->user->getState('emp_id');
		    }
		    if(!Yii::app()->user->isGuest && !Yii::app()->user->getState('parent_id'))
		    {
			$count = 0;
			$count = Mailbox::model()->newMsgs(Yii::app()->user->id);	
		     ?>
			<li><a href="<?php echo Yii::app()->baseUrl;?>/mailbox" class="nav-link green"><i class="fa fa-envelope"></i> <span class="nav-counter nav-counter-blue"><?php echo $count;?></span></a></li>
		   <?php			
		    }?>
                        <li><a href="#" class="nav-link orange"><i class="fa fa-tasks"></i> <span class="nav-counter nav-counter-green">15</span></a></li>
			<?php		
			$isStudent = Yii::app()->user->getState('stud_id');
			$isEmployee = Yii::app()->user->getState('emp_id');
			if(isset($isStudent))
			{
			  $stdinfo = StudentInfo::model()->findByAttributes(array('student_info_transaction_id'=>Yii::app()->user->getState('stud_id')));	
			  $stu_tran = StudentTransaction::model()->findByPk(Yii::app()->user->getState('stud_id'));
			  $stdpicPath = StudentPhotos::model()->findByPk($stu_tran->student_transaction_student_photos_id);
			  $stud_photo=Yii::app()->baseUrl."/college_data/stud_images/".$stdpicPath->student_photos_path;
			?>
コード例 #5
0
 public static function conversation($id, $order = 'DESC')
 {
     if (!is_int((int) $id)) {
         throw new Exception('Bad conversation Id');
     }
     $with = array('messages' => array('order' => 'created ' . $order));
     return Mailbox::model()->with($with)->findByPk($id);
 }
コード例 #6
0
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }