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


PHP Status::getIDFromName方法代码示例

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


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

示例1: searchPigQuery

 public function searchPigQuery($whereAdd, $orderBy = '', $limit = '', $count = false)
 {
     $config = new Configuration();
     $status = new Status();
     if ($config->settings->organizationsModule == 'Y') {
         $dbName = $config->settings->organizationsDatabaseName;
         $orgJoinAdd = "LEFT JOIN " . $dbName . ".Organization O ON O.organizationID = ROL.organizationID\n\t\t\t\t\t\t   LEFT JOIN " . $dbName . ".Alias OA ON OA.organizationID = ROL.organizationID";
     } else {
         $orgJoinAdd = "LEFT JOIN Organization O ON O.organizationID = ROL.organizationID";
     }
     $savedStatusID = intval($status->getIDFromName('saved'));
     //also add to not retrieve saved records
     $whereAdd[] = "R.statusID != " . $savedStatusID;
     if (count($whereAdd) > 0) {
         $whereStatement = " WHERE " . implode(" AND ", $whereAdd);
     } else {
         $whereStatement = "";
     }
     if ($count) {
         $select = "SELECT COUNT(DISTINCT R.resourceID) count";
         $groupBy = "";
     } else {
         $select = "SELECT R.resourceID, RF.shortName resourceFormatID, RT.shortName resourceTypeID, R.titleText, AT.shortName acquisitionType, R.createLoginID, CU.firstName, CU.lastName, R.createDate, R.providerText, R.descriptionText, R.resourceURL, S.shortName status, R.resourceAltURL,\n\t\t\t\t\t\tGROUP_CONCAT(DISTINCT A.shortName ORDER BY A.shortName DESC SEPARATOR '<br />') aliases";
         $groupBy = "GROUP BY R.resourceID";
     }
     $table_matches = array();
     // Build a list of tables that are referenced by the select and where statements in order to limit the number of joins performed in the search.
     preg_match_all("/[A-Z]+(?=[.][A-Z]+)/i", $select, $table_matches);
     $referenced_tables = array_unique($table_matches[0]);
     preg_match_all("/[A-Z]+(?=[.][A-Z]+)/i", $whereStatement, $table_matches);
     $referenced_tables = array_unique(array_merge($referenced_tables, $table_matches[0]));
     // These join statements will only be included in the query if the alias is referenced by the select and/or where.
     $conditional_joins = explode("\n", "LEFT JOIN ResourceFormat RF ON R.resourceFormatID = RF.resourceFormatID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceType RT ON R.resourceTypeID = RT.resourceTypeID\n\t\t\t\t\t\t\t\t\tLEFT JOIN AcquisitionType AT ON R.acquisitionTypeID = AT.acquisitionTypeID\n\t\t\t\t\t\t\t\t\tLEFT JOIN Status S ON R.statusID = S.statusID\n\t\t\t\t\t\t\t\t\tLEFT JOIN User CU ON R.createLoginID = CU.loginID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourcePurchaseSiteLink RPSL ON R.resourceID = RPSL.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceAuthorizedSiteLink RAUSL ON R.resourceID = RAUSL.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceAdministeringSiteLink RADSL ON R.resourceID = RADSL.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourcePayment RPAY ON R.resourceID = RPAY.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceNote RN ON R.resourceID = RN.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceStep RS ON R.resourceID = RS.resourceID");
     $additional_joins = array();
     foreach ($conditional_joins as $join) {
         $match = array();
         preg_match("/[A-Z]+(?= ON )/i", $join, $match);
         $table_name = $match[0];
         if (in_array($table_name, $referenced_tables)) {
             $additional_joins[] = $join;
         }
     }
     $query = $select . "\n\t\t\t\t\t\t\t\tFROM Resource R\n\t\t\t\t\t\t\t\t\tLEFT JOIN Alias A ON R.resourceID = A.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceOrganizationLink ROL ON R.resourceID = ROL.resourceID\n\t\t\t\t\t\t\t\t\t" . $orgJoinAdd . "\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceRelationship RRC ON RRC.relatedResourceID = R.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceRelationship RRP ON RRP.resourceID = R.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN ResourceSubject RSUB ON R.resourceID = RSUB.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN Resource RC ON RC.resourceID = RRC.resourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN Resource RP ON RP.resourceID = RRP.relatedResourceID\n\t\t\t\t\t\t\t\t\tLEFT JOIN GeneralDetailSubjectLink GDLINK ON RSUB.generalDetailSubjectLinkID = GDLINK.generalDetailSubjectLinkID\t\t\t\t\t\t\t\t\t\n                  " . implode("\n", $additional_joins) . "\n\t\t\t\t\t\t\t\t  " . $whereStatement . "\n\t\t\t\t\t\t\t\t  " . $groupBy;
     if ($orderBy) {
         $query .= "\nORDER BY {$orderBy}";
     }
     if ($limit) {
         $query .= "\nLIMIT {$limit}";
     }
     return $query;
 }
开发者ID:brandon-garcia,项目名称:CORAL_Addons,代码行数:51,代码来源:PigResource.php

示例2: Resource

$resourceID = $_POST['resourceID'];
if ($resourceID) {
    //get this resource
    $resource = new Resource(new NamedArguments(array('primaryKey' => $resourceID)));
} else {
    //set up new resource
    $resource = new Resource();
    $resource->createLoginID = $loginID;
    $resource->createDate = date('Y-m-d');
    $resource->updateLoginID = '';
    $resource->updateDate = '';
}
//determine status id
$status = new Status();
$statusID = $status->getIDFromName($_POST['resourceStatus']);
$resource->resourceTypeID = $_POST['resourceTypeID'];
$resource->resourceFormatID = $_POST['resourceFormatID'];
$resource->acquisitionTypeID = $_POST['acquisitionTypeID'];
$resource->titleText = $_POST['titleText'];
$resource->descriptionText = $_POST['descriptionText'];
$resource->isbnOrISSN = '';
$resource->statusID = $statusID;
$resource->orderNumber = '';
$resource->systemNumber = '';
$resource->userLimitID = '';
$resource->authenticationUserName = '';
$resource->authenticationPassword = '';
$resource->storageLocationID = '';
$resource->registeredIPAddresses = '';
$resource->providerText = $_POST['providerText'];
开发者ID:billdueber,项目名称:resources,代码行数:30,代码来源:submitNewResource.php

示例3: getOutstandingTasksByResource

 public function getOutstandingTasksByResource($outstandingResourceID)
 {
     $status = new Status();
     $excludeStatus = array();
     $excludeStatus[] = $status->getIDFromName('complete');
     $excludeStatus[] = $status->getIDFromName('archive');
     if (count($excludeStatus) > 1) {
         $whereAdd = "AND R.statusID NOT IN (" . implode(",", $excludeStatus) . ")";
     } else {
         if (count($excludeStatus) == 1) {
             $whereAdd = "AND R.statusID != '" . implode("", $excludeStatus) . "'";
         } else {
             $whereAdd = "";
         }
     }
     $query = "SELECT DISTINCT RS.stepName, date_format(stepStartDate, '%c/%e/%Y') startDate\n\t\t\tFROM Resource R, ResourceStep RS, UserGroupLink UGL\n\t\t\tWHERE R.resourceID = RS.resourceID\n\t\t\tAND RS.userGroupID = UGL.userGroupID\n\t\t\tAND UGL.loginID = '" . $this->loginID . "'\n\t\t\tAND R.resourceID = '" . $outstandingResourceID . "'\n\t\t\tAND (RS.stepEndDate IS NULL OR RS.stepEndDate = '0000-00-00')\n\t\t\tAND (RS.stepStartDate IS NOT NULL AND RS.stepStartDate != '0000-00-00')\n\t\t\t" . $whereAdd . "\n\t\t\tORDER BY 1 desc LIMIT 0,25";
     $result = $this->db->processQuery($query, 'assoc');
     $resourceArray = array();
     //need to do this since it could be that there's only one request and this is how the dbservice returns result
     if (isset($result['stepName'])) {
         foreach (array_keys($result) as $attributeName) {
             $resultArray[$attributeName] = $result[$attributeName];
         }
         array_push($resourceArray, $resultArray);
     } else {
         foreach ($result as $row) {
             $resultArray = array();
             foreach (array_keys($row) as $attributeName) {
                 $resultArray[$attributeName] = $row[$attributeName];
             }
             array_push($resourceArray, $resultArray);
         }
     }
     return $resourceArray;
 }
开发者ID:billdueber,项目名称:resources,代码行数:35,代码来源:User.php

示例4: Resource

<?php

$resourceID = $_GET['resourceID'];
$resource = new Resource(new NamedArguments(array('primaryKey' => $resourceID)));
$status = new Status();
$completeStatusID = $status->getIDFromName('complete');
$archiveStatusID = $status->getIDFromName('archive');
$resourceSteps = $resource->getResourceSteps();
if (count($resourceSteps) == "0") {
    if ($resource->statusID != $completeStatusID && $resource->statusID != $archiveStatusID) {
        echo "<i>" . _("No workflow steps have been set up for this resource's combination of Acquisition Type and Resource Format.") . "<br />" . _("If you think this is in error, please contact your workflow administrator.") . "</i>";
    } else {
        echo "<i>" . _("Not entered into workflow.") . "</i>";
    }
} else {
    ?>
			<table class='linedDataTable' style='width:100%;margin-bottom:5px;'>
				<tr>
				<th style='background-color:#dad8d8;width:350px;'><?php 
    echo _("Step");
    ?>
</th>
					<th style='background-color:#dad8d8;'>&nbsp;</th>
				<th style='background-color:#dad8d8;width:150px;'><?php 
    echo _("Group");
    ?>
</th>
				<th style='background-color:#dad8d8;width:120px;'><?php 
    echo _("Start Date");
    ?>
</th>
开发者ID:jcraitz,项目名称:resources,代码行数:31,代码来源:getRoutingDetails.php

示例5: date

$resource->updateLoginID = $loginID;
$resource->updateDate = date('Y-m-d H:i:s');
$resource->titleText = $_POST['titleText'];
$resource->descriptionText = $_POST['descriptionText'];
$resource->resourceFormatID = $_POST['resourceFormatID'];
$resource->resourceTypeID = $_POST['resourceTypeID'];
$resource->resourceURL = $_POST['resourceURL'];
$resource->resourceAltURL = $_POST['resourceAltURL'];
$isbnarray = json_decode($_POST['isbnOrISSN']);
$resource->setIsbnOrIssn($isbnarray);
//to determine status id
$status = new Status();
if ((!$resource->archiveDate || $resource->archiveDate == '0000-00-00') && $_POST['archiveInd'] == "1") {
    $resource->archiveDate = date('Y-m-d');
    $resource->archiveLoginID = $loginID;
    $resource->statusID = $status->getIDFromName('archive');
} else {
    if ($_POST['archiveInd'] == "0") {
        //if archive date is currently set and being removed, mark status as complete
        if ($resource->archiveDate != '' && $resource->archiveDate != '0000-00-00') {
            $resource->statusID = $status->getIDFromName('complete');
        }
        $resource->archiveDate = '';
        $resource->archiveLoginID = '';
    }
}
try {
    $resource->save();
} catch (Exception $e) {
    echo $e->getMessage();
}
开发者ID:billdueber,项目名称:resources,代码行数:31,代码来源:submitProductUpdate.php

示例6: completeWorkflow

 public function completeWorkflow()
 {
     $config = new Configuration();
     $util = new Utility();
     $status = new Status();
     $statusID = $status->getIDFromName('complete');
     if ($statusID) {
         $this->statusID = $statusID;
         $this->save();
     }
     //send notification to creator and master email address
     $cUser = new User(new NamedArguments(array('primaryKey' => $this->createLoginID)));
     //formulate emil to be sent
     $email = new Email();
     $email->message = $util->createMessageFromTemplate('CompleteResource', $this->resourceID, $this->titleText, '', $this->systemNumber, '');
     if ($cUser->emailAddress) {
         $emailTo[] = $cUser->emailAddress;
     }
     if ($config->settings->feedbackEmailAddress != '') {
         $emailTo[] = $config->settings->feedbackEmailAddress;
     }
     $email->to = implode(",", $emailTo);
     $email->subject = "CORAL Alert: Workflow completion for " . $this->titleText;
     $email->send();
 }
开发者ID:brandon-garcia,项目名称:resources,代码行数:25,代码来源:Resource.php


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