如何在使用php在cbuttoncolumn中单击删除链接时获取对话框文本框?

时间:2015-06-04 08:30:07

标签: php yii

当我在cButtonColumn中单击删除链接时,我收到确认消息“您确定要删除吗?”。但是我想要一个文本对话框供用户输入要删除的注释然后如果他在输入注释后单击“确定”,则应该从DB中删除它。

代码:

    array(
        'header'=>'Action',
        'class'=>'CButtonColumn',
        'template'=>'{AnnouncementLetter}<br/>
                        {EditAnnouncement}<br/>{SendReminder}<br/>{ViewAnnouncementSegment}<br/>{AcknowledgementFinance}<br/>{AcknowledgementSegment}<br/>{Delete}<br/><br/>'
                        /*{DeletePrf}*/
                        /*{Extend}'{AnnouncementSend}<br/>*/,
        'buttons'=>array(
                'AnnouncementLetter'=>array(
                                        'label'=>'Create Letter',
                                        'url' =>'CController::createUrl("/rebate/create", array("prfnumber"=>$data->prf_number,
                                                                                                                    ))',
                                        'visible'=>'$data->nacknowledged == 0 AND (Yii::app()->user->type == 2 OR Yii::app()->user->type == 1)',
                                        //Filter User here Ops Team/Claim Team/Admin. Announcement letter checker
                                        //Show Draft letter 

                                        ),
                'AnnouncementSend'=>array(
                                        'label'=>'Send',
                                        'url' =>'CController::createUrl("/prf/mail", array("prfnumber"=>$data->prf_number))',//need to use ajax instead here
                                        'visible'=>'(Yii::app()->user->type == 1 OR Yii::app()->user->type == 2) AND 
                                        ($data->nacknowledged==1 )',
                                        ),

                'EditAnnouncement'=>array(
                                        'label'=>'Edit Letter',
                                        'url' =>'CController::createUrl("/rebate/create", array("prfnumber"=>$data->prf_number,
                                                                                                                    ))',
                                        'visible'=>'($data->nacknowledged==1 OR $data->nacknowledged==5) AND (Yii::app()->user->type == 2 OR Yii::app()->user->type == 1)',

                                        ),
                'SendReminder'=>array(
                                        'label'=>'Send Reminder',
                                        'url'=>'CController::createUrl("/prf/ReminderMail", array("prfnumber"=>$data->prf_number))',
                                        'visible'=>'(Yii::app()->user->type == 1|| Yii::app()->user->type==2) && ($data->nacknowledged==3 OR $data->nacknowledged == 2)',
                                            'options'=>array('ajax'=>
                                                                array('success'=>'js:function(){alert("Reminder Sent")}',
                                                                        'url'=>'js:$(this).attr("href")')),             

                                        ),
                'ViewAnnouncementSegment'=>array(
                                            'label'=>'View Announcement',
                                            'url'=>'CController::createUrl("/annletter/segmentAcknowledge", array("prfnumber"=>$data->prf_number))',
                                            'visible'=>'(Yii::app()->user->type == 1 OR Yii::app()->user->type != 5) && ($data->nacknowledged==4 OR $data->nacknowledged==4)',

                                                            ),
                'AcknowledgementFinance'=>array(
                                            'label'=>'Acknowledge',
                                            'url'=>'CController::createUrl("/annletter/segmentAcknowledge", array("prfnumber"=>$data->prf_number))',
                                            'visible'=>'(Yii::app()->user->type == 1 OR Yii::app()->user->type==6) && ($data->nacknowledged==2)',

                                                        ),
                'AcknowledgementSegment'=>array(
                                            'label'=>'Acknowledge',
                                            'url'=>'CController::createUrl("/annletter/segmentAcknowledge", array("prfnumber"=>$data->prf_number))',
                                            'visible'=>'(Yii::app()->user->type == 1 OR  Yii::app()->user->type==4) && ($data->nacknowledged==3)',

                                                        ),
                'Delete'=>array(
                    'label'=>'Delete',
                    'url'=>'CController::createUrl("/prf/deleteRecord", array("prfnumber"=>$data->prf_number))',
                    'visible'=>'(Yii::app()->user->type == 6 AND $data->nacknowledged==4) OR Yii::app()->user->type == 1 ',

                            'options'=>array(
                                                    'confirm'=>'Are you sure you would like to delete?',
/*                                                          'ajax'=>array('success'=>'js:function(){alert("PRF Deleted")}',
                                                                        'url'=>'js:$(this).attr("href")')*/),

                                ),
                /*'DeletePrf'=>array(
                    'label'=>'Delete',
                    'url'=>'CController::createUrl("/prf/silentDelete", array("prfnumber"=>$data->prf_number))',
                    'visible'=>'(Yii::app()->user->type == 6 AND $data->nacknowledged != 4) OR Yii::app()->user->type == 1 ',

                            'options'=>array(
                                                    'confirm'=>'Are you sure you would like to delete?',
/*                                                          'ajax'=>array('success'=>'js:function(){alert("PRF Deleted")}',
                                                                        'url'=>'js:$(this).attr("href")')),

                                ),*/

                ),
    ),

),


)); 

0 个答案:

没有答案