@mdomba:
Thanks for pointing that out - I read about a few issues regarding IE in conjunction with Yii prior to 1.1.4, and I was SO DAMN sure I had updated, but it still was 1.1.2. Nevertheless, I still have the same issues after the update. What I am so confused about is that the blog demo works with IE and doesn’t show the behaviour I have with my project, though I am sure I have reflected all necessary stuff of the blog demo into my project. So, so far I think it still is a mistake in my code somewhere … and still it’s so strange that my project works with Firefox and Chrome without any flaws …
@SystemicPlural:
Since it’s quite some code, I tried to first ask if anything is known about the issue without “spamming the forum”
But since I so far also don’t see any other chance, here we go:
Controller:
<?php
class ReparaturenController extends Controller
{
private $_model;
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules()
{
return array(
array('allow', // allow authenticated users to access all actions
'users'=>array('@'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
public function actionIndex()
{
$model=new Reparaturen('search');
if(isset($_GET['Reparaturen']))
$model->attributes=$_GET['Reparaturen'];
$this->render('index',array(
'model'=>$model,
));
}
/**
* 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()
{
if($this->_model===null)
{
if(isset($_GET['rep_id']))
$this->_model=Reparaturen::model()->findbyPk($_GET['rep_id']);
if($this->_model===null)
throw new CHttpException(404,'The requested page does not exist.');
}
return $this->_model;
}
public function actionView()
{
$model=$this->loadModel();
$this->render('view',array(
'model'=>$model,
));
}
/**
* Performs the AJAX validation.
* @param CModel the model to be validated
*/
protected function performAjaxValidation($model)
{
if(isset($_POST['ajax']) && $_POST['ajax']==='grid-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
}
Model:
<?php
/**
* This is the model class for table "tbl_reparaturen".
*/
class Reparaturen extends CActiveRecord
{
/**
* The followings are the available columns in table 'tbl_reparaturen':
* @var integer $rep_id
* @var integer $rep_hersteller
* @var string $rep_type
* @var string $rep_gnr
* @var string $rep_lsnr
* @var string $rep_qname
* @var integer $rep_kunde
* @var integer $rep_status
* @var datetime $rep_wann
* @var string $sortherst
* @var string $rep_status_text
* @var string $rep_kva_jn
* @var string $rep_zubehoer
* @var string $rep_zst_text
* @var string $rep_vpk_text
* @var datetime $rep_vers_datum
* @var datetime $rep_fertig
* @var bool $rep_fertig_bool
*/
/**
* Returns the static model of the specified AR class.
* @return Reparaturen the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'tbl_reparaturen';
}
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('rep_id, rep_type, rep_gnr, rep_lsnr, rep_qname, rep_kunde, rep_status, sortherst, rep_kva_jn, rep_status_text, rep_zubehoer, rep_fertig_bool', 'required'),
array('rep_hersteller, rep_kunde, rep_status', 'numerical', 'integerOnly'=>true),
array('rep_type, rep_lsnr', 'length', 'max'=>20),
array('rep_gnr', 'length', 'max'=>40),
array('rep_qname', 'length', 'max'=>35),
array('sortherst', 'length', 'max'=>30),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('rep_id, rep_type, rep_gnr, rep_lsnr, rep_qname, rep_kunde, rep_status, sortherst, rep_status_text, rep_fertig_bool', 'safe', 'on'=>'search'),
);
}
/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'rep_id' => 'Reparaturnr.',
'rep_hersteller' => 'Hersteller',
'rep_type' => 'Gerätetyp',
'rep_gnr' => 'Seriennummer',
'rep_lsnr' => 'Ihre Referenz',
'rep_qname' => 'Kundenname',
'rep_kunde' => 'Kundennummer',
'rep_status' => 'Status',
'rep_wann' => 'Letzte Änderung',
'sortherst' => 'Hersteller',
'rep_status_text' => 'Status',
'rep_kva_jn' => 'Leistungsart',
'rep_zubehoer' => 'Zubehör',
'rep_zst_text' => 'Zustand',
'rep_vpk_text' => 'Verpackung',
'rep_vk_datum' => 'Verkaufsdatum',
'rep_vers_datum' => 'Vorauss. Liefertermin',
'rep_fertig_bool' => 'Abschluss',
);
}
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('rep_id',$this->rep_id);
$criteria->compare('rep_type',$this->rep_type,true);
$criteria->compare('rep_gnr',$this->rep_gnr,true);
$criteria->compare('rep_lsnr',$this->rep_lsnr,true);
$criteria->compare('rep_qname',$this->rep_qname,true);
$criteria->compare('rep_kunde', Yii::app()->user->name);
$criteria->compare('rep_status',$this->rep_status,true);
$criteria->compare('sortherst',$this->sortherst,true);
$criteria->compare('rep_status_text',$this->rep_status_text,true);
$criteria->compare('rep_fertig_bool',$this->rep_fertig_bool,true);
return new CActiveDataProvider(get_class($this), array(
'criteria'=>$criteria,
));
}
}
View:
<style type="text/css">
td { border:none; padding:0px;}
</style>
<?php
$this->breadcrumbs=array(
'Reparaturen',
);?>
<?php
Yii::app()->clientScript->registerScript('search', "
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('reparaturen-grid', {
data: $(this).serialize()
});
return false;
});
");?>
<div class="search-form">
<?php $this->renderPartial('_search',array(
'model'=>$model,
)); ?>
</div><!-- search-form -->
</div><!-- form -->
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'reparaturen-grid',
'dataProvider'=>$model->search(),
'columns'=>array(
array(
'class'=>'CButtonColumn',
'template'=>'{view}',
),
array(
'class'=>'CLinkColumn',
'header'=>'<a href="/rapido/index.php/reparaturen/index?Reparaturen_sort=rep_lsnr">Ihre Referenz</a>',
'labelExpression'=>'$data->rep_lsnr',
'urlExpression'=>'Yii::app()->createUrl("reparaturen/view",array("id"=>$data->rep_id))',
'htmlOptions'=>array('style'=>'text-align:center'),
),
array(
'class'=>'CLinkColumn',
'header'=>'<a href="/rapido/index.php/reparaturen/index?Reparaturen_sort=rep_id">Reparaturnummer</a>',
'labelExpression'=>'$data->rep_id',
'urlExpression'=>'Yii::app()->createUrl("reparaturen/view",array("id"=>$data->rep_id))',
'htmlOptions'=>array('style'=>'text-align:center'),
),
array(
'name'=>'sortherst',
'htmlOptions'=>array('style'=>'text-align:center'),
),
array(
'name'=>'rep_type',
),
array(
'name'=>'rep_status_text',
),
array(
'name'=>'rep_wann',
'value'=>'$data->rep_wann',
'htmlOptions'=>array('style'=>'text-align:center'),
),
),
)); ?>
_Search:
<div class="wide form">
<?php $form=$this->beginWidget('CActiveForm', array(
'action'=>Yii::app()->createUrl($this->route),
'method'=>'get',
)); ?>
<table style="padding:0px;">
<tr>
<td style="width:300px">
<div class="row">
<?php echo $form->labelEx($model,'rep_lsnr'); ?>
<?php echo $form->textField($model,'rep_lsnr'); ?>
</div>
</td>
<td style="width:300px">
<div class="row">
<?php echo $form->labelEx($model,'rep_hersteller'); ?>
<?php echo CHtml::activeDropDownList($model, 'sortherst', CHtml::listData(Reparaturen::model()->findAll(array('order'=>'sortherst')), 'sortherst', 'sortherst'), array('empty'=>'Keine Auswahl', 'style'=>'width:154px')) ; ?>
</div>
</td>
<td style="width:330px">
<div class="row">
<?php echo $form->labelEx($model,'rep_fertig_bool'); ?>
<?php echo CHtml::activeDropDownList($model, 'rep_fertig_bool', array('false'=>'Offene Aufträge','true'=>'Abgeschlossene Aufträge'), array('empty'=>'Keine Auswahl', 'style'=>'width:200px', 'submit'=>'')) ; ?>
</div>
</td>
</tr>
<tr>
<td style="width:300px">
<div class="row">
<?php echo $form->labelEx($model,'rep_id'); ?>
<?php echo $form->textField($model,'rep_id'); ?>
</div>
</td>
<td style="width:300px">
<div class="row">
<?php echo $form->labelEx($model,'rep_type'); ?>
<?php echo $form->textField($model,'rep_type'); ?>
</div>
</td>
<td style="width:330px">
<div class="row">
<?php echo $form->labelEx($model,'rep_status_text'); ?>
<?php echo CHtml::activeDropDownList($model, 'rep_status_text', CHtml::listData(Reparaturen::model()->findAll(array('order'=>'rep_status_text')), 'rep_status_text', 'rep_status_text'), array('empty'=>'Keine Auswahl', 'style'=>'width:200px', 'submit'=>'')) ; ?>
</div>
</td>
</tr>
<tr>
<td style="width:300px">
<div class="row">
<?php echo $form->labelEx($model,'rep_qname'); ?>
<?php echo $form->textField($model,'rep_qname'); ?>
</div>
</td>
<td style="width:300px">
<div class="row">
<?php echo $form->labelEx($model,'rep_gnr'); ?>
<?php echo $form->textField($model,'rep_gnr'); ?>
</div>
</td>
<td>
<div class="row buttons">
<?php echo CHtml::submitButton('Daten abfragen', array('style'=>'width:200px')); ?>
</div>
</td>
</tr>
</table>
<?php $this->endWidget(); ?>
</div><!-- search-form -->
So far so good … as mentioned earlier, I have setup the urlManager as suggested by qiang, but have not had any success with that.
I’d be glad about any hint whatsoever!