本文整理汇总了PHP中Issue::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::model方法的具体用法?PHP Issue::model怎么用?PHP Issue::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Issue
的用法示例。
在下文中一共展示了Issue::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionView
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
$step = $this->loadModel($id);
$issue = null;
if (isset($_GET['issueId'])) {
if ($_GET['issueId'] != '') {
$issue = Issue::model()->find('id=' . $_GET['issueId']);
}
if ($issue) {
if ($issue->status == 0) {
$this->layout = "//layouts/column1";
}
}
}
if (isset($_POST['position'])) {
$step->sortElement($_POST['position']);
exit("ok");
}
$comment = $this->createComment($step, $issue);
$element = $this->createElement($step);
$text = $this->createText($step);
$subStepModel = $this->createSubStep($step);
$file = $this->createFile($step);
$link = $this->createLink($step);
$this->render('view', array('model' => $step, 'comment' => $comment, 'element' => $element, 'file' => $file, 'link' => $link, 'text' => $text, 'subStepModel' => $subStepModel, 'issue' => $issue));
}
示例2: loadIssue
public function loadIssue($id)
{
$model = Issue::model()->find("id = {$id}");
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例3: testGetTypes
public function testGetTypes()
{
$options = Issue::model()->typeOptions;
$this->assertTrue(is_array($options));
$this->assertTrue(3 == count($options));
$this->assertTrue(in_array('Bug', $options));
$this->assertTrue(in_array('Feature', $options));
$this->assertTrue(in_array('Task', $options));
}
示例4: testGetStatus
public function testGetStatus()
{
$options = Issue::model()->statusOptions;
$this->assertTrue(is_array($options));
$this->assertTrue(3 == count($options));
$this->assertTrue(in_array('Not yet started', $options));
$this->assertTrue(in_array('Started', $options));
$this->assertTrue(in_array('Finished', $options));
}
示例5: actionDelete
public function actionDelete($id)
{
// make sure we have that id
$issue = Issue::model()->findByPk($id);
if (!$issue) {
$this->sendError("Sorry, That issue was not found.");
}
$issue->delete();
$this->send("");
}
示例6: getTravelersList
public function getTravelersList()
{
$new = Yii::t('default', 'New Version Pending');
$travelerId = Issue::model()->findColumn('travelerId', 'equipmentId = ' . $this->id);
$notIn = "";
if ($travelerId) {
$ids = '';
foreach ($travelerId as $id) {
$traveler = Traveler::model()->findByPk($id);
if ($traveler->parentId) {
$ids .= $traveler->parentId . ',';
} else {
$ids .= $traveler->id . ',';
}
}
if ($ids != '') {
$ids = substr($ids, 0, -1);
$notIn = "AND (parentId NOT IN ({$ids}) OR parentId IS NULL)";
//exit($notIn);
}
}
$criteria = new CDbCriteria();
/*$criteria->select = array("CASE status WHEN 0 THEN name+' (v'+CAST(revision as varchar)+')' ELSE name+' (v'+CAST(revision as varchar)+') -> !!$new' END as name", "id"); ORACLE*/
$criteria->select = array("CASE status WHEN 0 THEN CONCAT(name, ' (v', revision, ')') ELSE CONCAT(name, ' (v', revision, ') -> !!{$new}') END as name", "id");
$criteria->condition = "componentId = {$this->componentId} AND status < 1 {$notIn}";
$criteria->addNotInCondition('id', $travelerId);
$travelers = Traveler::model()->findAll($criteria);
if ($travelers) {
return CHtml::listData($travelers, 'id', 'name');
} else {
return false;
}
}
示例7: loadModel
/**
* 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.
*/
public function loadModel($withComments=false)
{
if($this->_model===null)
{
if(isset($_GET['id']))
{
if($withComments)
{
$this->_model=Issue::model()->with(array(
'comments'=>array('with'=>'author')))->findbyPk($_GET['id']);
}
else
{
$this->_model=Issue::model()->findbyPk($_GET['id']);
}
}
if($this->_model===null)
throw new CHttpException(404,'The requested page does not exist.');
}
return $this->_model;
}
示例8: array
<?php
/* @var $this StaffController */
/* @var $model Staff */
$this->breadcrumbs = array('Staff' => array('index'), $model->id);
$this->menu = array(array('label' => 'List Staff', 'url' => array('index')), array('label' => 'Create Staff', 'url' => array('create')), array('label' => 'Update Staff', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete Staff', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage Staff', 'url' => array('admin')));
?>
<h1>View Staff #<?php
echo $model->id;
?>
</h1>
<?php
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', 'fullName', 'usrName', 'email', 'locationname', 'payrollNo')));
?>
<?php
$query = Issue::model()->findAllByAttributes(array('fk_staff' => $model->id));
$dataProvider = new CArrayDataProvider($rawData = $query);
$this->widget('zii.widgets.grid.CGridView', array('dataProvider' => $dataProvider, 'columns' => array(array('name' => 'id', 'header' => 'ID'), array('name' => 'componenttag', 'header' => 'Device TagNo'), array('name' => 'dateIssued', 'header' => 'Date Issued'), array('name' => 'dateReturned', 'header' => 'Date Returned'), array('name' => 'locationname', 'header' => 'Location'), array('name' => 'hostname', 'header' => 'HostName'))));
示例9: getIssueByPkFk
public function getIssueByPkFk($travelerId, $equipmentId)
{
$issue = Issue::model()->find("travelerId = {$travelerId} AND equipmentId = {$equipmentId}");
if ($issue) {
return $issue;
} else {
return null;
}
}
示例10: setLinks
public function setLinks()
{
if ($this->deviceStatus == 'In Store') {
return CHtml::link("Issue", array("Issue/create", "fk_componentDetail" => $this->id));
} else {
if ($this->deviceStatus == 'In Use') {
$criteria = new CDbCriteria();
$criteria->condition = "fk_componentDetail = " . $this->id;
$criteria->order = "id desc";
$criteria->limit = 1;
$issue = Issue::model()->findAll($criteria);
if ($issue) {
return CHtml::link("Return", array("Issue/update", "id" => $issue[0]['id']));
}
} else {
return "";
}
}
}
示例11: getTravelerName
public function getTravelerName($id)
{
$id = (int) $id;
$criteria = new CDbCriteria();
$criteria->condition = "id={$id}";
$issue = Issue::model()->find($criteria);
//$issue= Issue::model()->findByPk($id); doesnt work!why?
$traveler = Traveler::model()->findByPk($issue->travelerId);
return $traveler->name;
}
示例12: actionIndex
/**
* Lists all models.
*/
public function actionIndex()
{
$this->layout = "//layouts/column1";
if (isset($_GET['issueId'])) {
$issue = Issue::model()->find("id = " . $_GET['issueId']);
$dataProvider = new CActiveDataProvider('Discrepancy', array('criteria' => array('condition' => "issueId = {$issue->id}")));
$this->render('index', array('dataProvider' => $dataProvider, 'issue' => $issue));
} else {
$model = new Discrepancy('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Discrepancy'])) {
$model->attributes = $_GET['Discrepancy'];
}
$this->render('admin', array('model' => $model));
}
}
示例13: array
<div class="view">
<?php
$issue = Issue::model()->getIssueByPkFk($data->id, $equipmentId);
$issueId = $issue->id;
$progress = $issue->progressText;
?>
<?php
echo CHtml::link(CHtml::encode($data->name) . " (v{$data->revision})", array('issue/view', 'id' => $issueId)) . " <b>({$progress})</b>";
?>
</div>
示例14: loadModel
/**
* 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 the ID of the model to be loaded
*/
public function loadModel($id, $withComments = false)
{
if ($withComments) {
$model = Issue::model()->with(array('comments' => array('with' => 'author')))->findByPk($id);
} else {
$model = Issue::model()->findByPk($id);
}
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例15: deleteIssue
/**
* Remove an issue assignment for this event.
*
* @param $name
*
* @return bool
*/
public function deleteIssue($name)
{
if (!($issue = Issue::model()->find('name=?', array($name)))) {
return false;
}
foreach (EventIssue::model()->findAll('event_id=? and issue_id = ?', array($this->id, $issue->id)) as $event_issue) {
$event_issue->delete();
}
return true;
}