/** * Displays a particular model. * @param integer $id the ID of the model to be displayed */ public function actionView($id) { $model=$this->loadModel($id); $model->assignedTo=UserChild::getUserLinks($model->assignedTo); $type='project'; parent::actionView($model,$type); }
/** * Displays a particular model. * @param integer $id the ID of the model to be displayed */ public function actionView($id) { $type = 'sales'; $model = $this->loadModel($id); $model->assignedTo = UserChild::getUserLinks($model->assignedTo); $model->associatedContacts = ContactChild::getContactLinks($model->associatedContacts); parent::actionView($model, $type); }
/** * Displays a particular model. * @param integer $id the ID of the model to be displayed */ public function actionView($id) { $model=$this->loadModel($id); $model->assignedTo=UserChild::getUserLinks($model->assignedTo); $str = ''; $contacts=ContactChild::model()->findAllByAttributes(array('company'=>$model->name)); foreach($contacts as $contact){ $str.=$contact->id.' '; } $model->associatedContacts=$str; $model->associatedContacts=ContactChild::getContactLinks($model->associatedContacts); $type='accounts'; parent::actionView($model, $type); }
</div> <div class="description"> <?php $template="<a href=".$this->createUrl('search/search?term=%23\\2')."> #\\2</a>"; $info=$data->actionDescription; $info=mb_ereg_replace('(^|\s)#(\w\w+)',$template,$info); if($data->type=='attachment' && $data->completedBy!='Email') echo MediaChild::attachmentActionText($data->actionDescription,true,true); else echo $this->convertLineBreaks($info,true); // convert LF and CRLF to <br /> ?> </div> <div class="footer"> <?php if(empty($data->type)) { if ($data->complete == 'Yes') { echo Yii::t('actions','Completed by {name}',array('{name}'=>UserChild::getUserLinks($data->completedBy))); } else { $userLink = UserChild::getUserLinks($data->assignedTo); $userLink = empty($userLink)? Yii::t('actions','Anyone') : $userLink; echo Yii::t('actions','Assigned to {name}',array('{name}'=>$userLink)); } } else if ($data->type == 'note') { echo UserChild::getUserLinks($data->completedBy); echo ' '.ActionChild::formatDate($data->completeDate); } else if ($data->type == 'attachment' && $data->completedBy!='Email') { echo Yii::t('media','Uploaded by {name}',array('{name}'=>UserChild::getUserLinks($data->completedBy))); } ?> </div> </div>
<td class="label" width="25%"><?php echo $attributeLabels['name']; ?></td> <td><?php echo $model->name; ?></td> </tr> <?php if($moduleConfig['descriptionDisplay']=='1'){ ?> <tr> <td class="label"> <?php echo $attributeLabels['description']; ?> </td> <td class="text-field"><div class="spacer"></div> <?php echo $this->convertUrls($model->description); ?> </td> </tr><?php } ?> <?php if($moduleConfig['assignedToDisplay']=='1'){ ?> <tr> <td class="label"><?php echo $attributeLabels['assignedTo']; ?></td> <td><?php echo ($model->assignedTo=='Anyone')? $model->assignedTo : UserChild::getUserLinks($model->assignedTo); ?></td> </tr><?php } ?> <?php if($moduleConfig['displayOne']=='1'){ ?> <tr> <td class="label"><?php echo $attributeLabels['fieldOne']; ?></td> <td><?php echo $model->fieldOne; ?></td> </tr><?php }?> <?php if($moduleConfig['displayTwo']=='1'){ ?> <tr> <td class="label"><?php echo $attributeLabels['fieldTwo']; ?></td> <td><?php echo $model->fieldTwo; ?></td> </tr><?php } ?> <?php if($moduleConfig['displayThree']=='1'){ ?> <tr> <td class="label"><?php echo $attributeLabels['fieldThree']; ?></td> <td><?php echo $model->fieldThree; ?></td>
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('name',$this->name,true); $criteria->compare('website',$this->website,true); $criteria->compare('type',$this->type,true); $criteria->compare('annualRevenue',$this->annualRevenue); $criteria->compare('phone',$this->phone,true); $criteria->compare('tickerSymbol',$this->tickerSymbol,true); $criteria->compare('employees',$this->employees); $criteria->compare('assignedTo',$this->assignedTo,true); $criteria->compare('associatedContacts',$this->associatedContacts,true); $criteria->compare('description',$this->description,true); $dataProvider=new SmartDataProvider(get_class($this), array( 'sort'=>array('defaultOrder'=>'name ASC'), 'pagination'=>array( 'pageSize'=>ProfileChild::getResultsPerPage(), ), 'criteria'=>$criteria, )); $arr=$dataProvider->getData(); foreach($arr as $account){ $account->assignedTo=UserChild::getUserLinks($account->assignedTo); $account->associatedContacts=ContactChild::getContactLinks($account->associatedContacts); } $dataProvider->setData($arr); return $dataProvider; }