当前位置: 首页>>代码示例>>PHP>>正文


PHP DocumentRevision::mark_deleted方法代码示例

本文整理汇总了PHP中DocumentRevision::mark_deleted方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentRevision::mark_deleted方法的具体用法?PHP DocumentRevision::mark_deleted怎么用?PHP DocumentRevision::mark_deleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DocumentRevision的用法示例。


在下文中一共展示了DocumentRevision::mark_deleted方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDeleteRelateDocumentRevision

 /**
  * @group 61144
  */
 public function testDeleteRelateDocumentRevision()
 {
     $this->revision->mark_deleted($this->revision->id);
     $actual = $this->revision->get_document_revision_name($this->revision->id);
     $this->assertEmpty($actual, 'Deleted data is returned');
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:9,代码来源:Bug61144Test.php

示例2: Document

 function oqc_cleanup_document_revision($id)
 {
     $contract = new $this->object_name();
     if ($contract->retrieve($id)) {
         if (!empty($contract->document_id)) {
             $document = new Document();
             if ($document->retrieve($contract->document_id)) {
                 if (!empty($document->document_revision_id)) {
                     $revision = new DocumentRevision();
                     if ($revision->retrieve($document->document_revision_id)) {
                         if ($revision->revision == $contract->version) {
                             $revision->mark_deleted($revision->id);
                         }
                     }
                     $document->document_revision_id = '';
                     //$document->document_revision_id = null;
                     $document->save();
                 }
             }
         }
     }
 }
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:22,代码来源:oqc_ContractBase.php

示例3: Document

 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
 * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 ********************************************************************************/
/*********************************************************************************
 * Description:  Deletes an Account record and then redirects the browser to the 
 * defined return URL.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
global $mod_strings;
if (!isset($_REQUEST['record'])) {
    sugar_die($mod_strings['ERR_DELETE_RECORD']);
}
$focus = new Document();
$focus->retrieve($_REQUEST['record']);
if (!$focus->ACLAccess('Delete')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
if (isset($_REQUEST['object']) && ($_REQUEST['object'] = "documentrevision")) {
    //delete document revision.
    $focus = new DocumentRevision();
    UploadFile::unlink_file($_REQUEST['revision_id'], $_REQUEST['filename']);
}
$focus->mark_deleted($_REQUEST['record']);
header("Location: index.php?module=" . $_REQUEST['return_module'] . "&action=" . $_REQUEST['return_action'] . "&record=" . $_REQUEST['return_id']);
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:31,代码来源:Delete.php

示例4: createPdf

function createPdf($contract)
{
    //1.7.6 fix for document category
    global $timedate;
    global $app_list_strings;
    global $current_user;
    global $sugar_config;
    $beanname = get_class($contract);
    $document_category = substr(trim($beanname), 4);
    if ($document_category == 'Offering') {
        $document_category = 'Quote';
    }
    $oqc_run = false;
    //Try to find if some version of contract had document_id created
    if ($contract->document_id == null) {
        $legacy_document_id = $contract->find_document_id($contract);
        $contract->document_id = $legacy_document_id;
        $GLOBALS['log']->error('OQC: Found contract_id! ' . $contract->document_id);
        if (!empty($contract->document_id)) {
            $oqc_run = true;
        }
    }
    //$conf = Configuration::getInstance();
    if (DEBUG_PDF_CREATION) {
        $oqc_run = true;
    }
    $document = new Document();
    if (!$document->retrieve($contract->document_id)) {
        //Creating document name for the first time
        $document->document_name = $document_category . 'Pdf-' . $contract->svnumber;
        $document->category_id = $document_category;
        $document->subcategory_id = 'Pdf';
        $document->active_date = date($timedate->get_date_format());
        $document->status_id = "Active";
        $document->document_purpose_c = "Customer";
        $document->assigned_user_id = $current_user->id;
        // create an id for this new document
        $document->save();
        $document->new_with_id = false;
        //1.7.8 Since sugar 6.2 document saving generated error- this is fix for it
        $oqc_done = createNewRevision($contract, $document);
    } else {
        $revision = new DocumentRevision();
        if (!$document->document_revision_id) {
            $oqc_run = true;
        }
        $revision->retrieve($document->document_revision_id);
        if ($contract->version == $revision->revision && $oqc_run == false) {
            //SET TO TRUE FOR PDF CREATION INDEPENDENT ON VERSION
            // do not create new revision since pdf file is already created for this revision. Normally, only one pdf
            // file can be created for each revision.
            $GLOBALS['log']->fatal('OQC: File already exist -skip file conversion to PDF!');
            header("Location:index.php?entryPoint=download&id={$document->document_revision_id}&type=Documents");
            exit;
        } else {
            if ($contract->version == $revision->revision && $oqc_run == true) {
                $revision->mark_deleted($revision->id);
                $GLOBALS['log']->error('OQC: Deleted inactive document revision!');
            }
            $document->active_date = date($timedate->get_date_format());
            $document->status_id = 'Active';
            $document->assigned_user_id = $current_user->id;
            $document->save();
            $document->new_with_id = false;
            $oqc_done = createNewRevision($contract, $document);
        }
    }
    if ($oqc_done) {
        $document->save();
        $documents = 'documents';
        $contract->load_relationship($documents);
        $contract->documents->add($document->id);
        $contract->document_id = $document->id;
        $contract->save();
        header("Location: index.php?action=DetailView&module=DocumentRevisions&record={$document->document_revision_id}");
        exit;
    } else {
        if (!$contract->document_id) {
            $document->mark_deleted($document->id);
            //This was new document, so delete it if pdf creation fails
        }
        echo "<html>\n\t\t\tPdf creation failed. Set debugPdfCreation=1 in config file and re-run creation of pdf file to get error log. </br>\n\t\t\t<a href=\"{$sugar_config['site_url']}/index.php?action=DetailView&module={$beanname}&record={$contract->id}\">Return to previuos page</a>\n\t\t\t</html>";
        exit;
    }
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:85,代码来源:oqc_CreatePdf.php


注:本文中的DocumentRevision::mark_deleted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。