/**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return User the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Opendocs::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 2
0
 public function cleanRecords()
 {
     //delete 24h older records
     Opendocs::model()->deleteAll(" createTime<=(NOW()-1)");
     //oracle
 }
 public function actionunlockIssue($id)
 {
     $opened = Opendocs::model()->find("issueId={$id}");
     if ($opened->delete()) {
         //crea otro opendoc
         $model = new Opendocs();
         $model->issueId = $id;
         $model->userId = Yii::app()->user->id;
         $model->createTime = new CDbExpression('GETDATE()');
         $model->save();
         //carga issue
         $issue = $this->loadIssue($id);
         $traveler = $issue->traveler;
         $issueId = $id;
         /*
         $this->render('update', array(
         		'model' => $issue,
         		'traveler' => $issue->traveler,
         		'issueId' => $issueId,
         	));
         */
         $this->render('opened', array('issueId' => $issueId));
     }
 }
Exemplo n.º 4
0
    ?>

						<?php 
    if ($estatus == "0") {
        echo " <li><span class='equipment' title='Equipment'>" . CHtml::link($ename, array('view', 'id' => $eid), array('class' => 'green'), array('onclick' => 'mostra_loading_screen()')) . "</span>";
    } else {
        echo " <li><span class='equipment' title='Equipment'>" . CHtml::link($ename, array('view', 'id' => $eid), array('onclick' => 'mostra_loading_screen()')) . "</span>";
    }
    if ($travelers) {
        echo "<ul>";
        //echo date("h:i:s:u");
        foreach ($travelers as $traveler) {
            $issue = Issue::model()->getIssueByPkFk($traveler->id, $eid);
            $issueId = $issue->id;
            // $progress = $issue->progressText; AND <div id="progreso" onclick='loadXMLDoc(<?php echo $issueId
            $opendocs = Opendocs::model()->find("userId!={$userId} and issueId={$issueId} and createTime > DATE_SUB(NOW(), INTERVAL 1 DAY)");
            //Mysql
            ?>
									
									<li><span class='issue' title='Issued template'>
									<?php 
            if (isset($opendocs)) {
                echo CHtml::link(CHtml::encode($traveler->name) . " (v{$traveler->revision})", array('issue/view', 'id' => $issueId), array('class' => 'red'), array('onclick' => 'mostra_loading_screen()'));
            } else {
                if ($issue->status == 0) {
                    echo CHtml::link(CHtml::encode($traveler->name) . " (v{$traveler->revision})", array('issue/view', 'id' => $issueId), array('class' => 'green'), array('onclick' => 'mostra_loading_screen()'));
                } else {
                    echo CHtml::link(CHtml::encode($traveler->name) . " (v{$traveler->revision})", array('issue/view', 'id' => $issueId), array('onclick' => 'mostra_loading_screen()'));
                }
            }
            ?>