本文整理汇总了PHP中Documents::hasDeletePermission方法的典型用法代码示例。如果您正苦于以下问题:PHP Documents::hasDeletePermission方法的具体用法?PHP Documents::hasDeletePermission怎么用?PHP Documents::hasDeletePermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Documents
的用法示例。
在下文中一共展示了Documents::hasDeletePermission方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
?>
<h1 class="w9_header">W9 Detail: <?=@CHtml::encode(Yii::app()->user->userLogin);?><span class="right items_to_review">W9s to review: <?php echo $num_pages; ?> items</span></h1>
<div class="account_manage">
<div class="account_header_left left">
<button class="button" id="send_document_by_fax" data="<?php echo $client->Client_ID; ?>">Fax</button>
<button class="button" id="send_document_by_email" data="<?php echo $client->Client_ID; ?>">Email</button>
<?php
if (strpos($file->Mime_Type, 'pdf') === false) {
echo '<button class="button" id="print_document" data="' . $company->Company_Fed_ID . '">Print</button>';
}
if ($w9->Access_Type == 1) {
echo '<button class="button" id="share_document" data-id="' . $w9->W9_ID . '">Share</button>';
}
if (Documents::hasDeletePermission($w9->Document_ID,Documents::W9,Yii::app()->user->userID,Yii::app()->user->clientID)) {
echo '<button class="button" id="delete_document" data-href="' . Yii::app()->createUrl('documents/deletedocument', array('doc_for_delete'=>$w9->Document_ID) ). '">Delete</button>';
}
?>
</div>
<?php $this->renderPartial('application.views.widgets.pages_navigation', array(
'page' => $page,
'num_pages' => $num_pages,
'url' => '/w9/detail',
)); ?>
</div>
<div class="wrapper">
<div class="w9_details">
<span class="right created_on">Created on: <span class="created_on_date"><?php echo Helper::convertDateString($lastDocument->Created); ?></span></span>
<h2><?php echo CHtml::encode($company->Company_Name); ?></h2>
<table class="details_table">
示例2: intval
* Created by PhpStorm.
* User: lee
* Date: 9/18/14
* Time: 1:02 PM
*/
echo '<div style="margin-left: 100px;width: 200px;">';
if($docId) {
$id = intval($docId);
$str=0;
//check if current document can be deleted or replaced
$doc_to_modify = Documents::model()->findByPk($id);
$can_be_changed = false;
if (
//1
(Documents::hasAccess($id) && Documents::hasDeletePermission($id, $doc_to_modify->Document_Type, Yii::app()->user->userID, Yii::app()->user->clientID))
||
//2
(Yii::app()->user->userType == UsersClientList::APPROVER)
)
{
$can_be_changed = true;
}
} else if ($file_name) {
$id=$file_name;
$str=1;
} else if ($imgId) {
$id= $imgId;
$str=0;