當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Documents::hasDeletePermission方法代碼示例

本文整理匯總了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">
開發者ID:ranvijayj,項目名稱:htmlasa,代碼行數:31,代碼來源:detail.php

示例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;
開發者ID:ranvijayj,項目名稱:htmlasa,代碼行數:31,代碼來源:buttons.php


注:本文中的Documents::hasDeletePermission方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。