本文整理汇总了PHP中Release类的典型用法代码示例。如果您正苦于以下问题:PHP Release类的具体用法?PHP Release怎么用?PHP Release使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Release类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_new_record_form
/**
* Create HTML form to enter a new record with the minimum necessary fields.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
*/
function get_new_record_form()
{
if (!ACLController::checkAccess('Bugs', 'edit', true)) {
return '';
}
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $theme;
global $current_user;
$seedRelease = new Release();
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_default_status = $app_list_strings['bug_status_default_key'];
$lbl_subject = $mod_strings['LBL_SUBJECT'];
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
$user_id = $current_user->id;
$priority_options = get_select_options_with_id($app_list_strings['bug_priority_dom'], $app_list_strings['bug_priority_default_key']);
$release_options = get_select_options_with_id($seedRelease->get_releases(TRUE, "Active"), "");
$type_options = get_select_options_with_id($app_list_strings['bug_type_dom'], $app_list_strings['bug_type_default_key']);
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
$the_form .= <<<EOQ
\t\t<form name="BugSave" onSubmit="return check_form('BugSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Bugs">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="status" value="{$lbl_default_status}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="action" value="Save">
\t\t{$lbl_subject} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<p><input name='name' type="text" size='20' maxlength="255"value=""><br>
\t\t{$mod_strings['LBL_TYPE']} <br>
\t\t<select name='type' >{$type_options}</select><br>
\t\t{$mod_strings['LBL_RELEASE']} <br>
\t\t<select name='found_in_release' >{$release_options}</select><br>
\t\t{$mod_strings['LBL_PRIORITY']} <br>
\t\t<select name='priority' >{$priority_options}</select>
</p><p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value=" {$lbl_save_button_label} " ></p>
\t\t</form>
EOQ;
require_once 'include/javascript/javascript.php';
require_once 'modules/Bugs/Bug.php';
$javascript = new javascript();
$javascript->setFormName('BugSave');
$javascript->setSugarBean(new Bug());
$javascript->addRequiredFields('');
$the_form .= $javascript->getScript();
$the_form .= get_left_form_footer();
return $the_form;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:64,代码来源:Forms.php
示例2: displayOptions
function displayOptions()
{
$this->processDisplayOptions();
$seedRelease = new Release();
$this->currentSearchFields['fixed_in_release']['input'] = '<select multiple="true" size="3" name="fixed_in_release[]">' . get_select_options_with_id($seedRelease->get_releases(false, "Active"), empty($this->filters['fixed_in_release']) ? '' : $this->filters['fixed_in_release']) . '</select>';
$this->currentSearchFields['found_in_release']['input'] = '<select multiple="true" size="3" name="found_in_release[]">' . get_select_options_with_id($seedRelease->get_releases(false, "Active"), empty($this->filters['found_in_release']) ? '' : $this->filters['found_in_release']) . '</select>';
$this->configureSS->assign('searchFields', $this->currentSearchFields);
return $this->configureSS->fetch($this->configureTpl);
}
开发者ID:klr2003,项目名称:sourceread,代码行数:9,代码来源:MyBugsDashlet.php
示例3: addRelease
/**
* @return ReleaseSetBuilder
*/
protected function addRelease(Release $release, $isLatest = false)
{
$this->releases[$release->getDate()->getDayStartStamp()] = $release;
if ($isLatest) {
$this->latest = $release;
} else {
ksort($this->releases);
$this->latest = end($this->releases);
}
return $this;
}
开发者ID:phoebius,项目名称:phoebius.com,代码行数:14,代码来源:ReleaseSetBuilder.class.php
示例4: testbuild_generic_where_clause
public function testbuild_generic_where_clause()
{
$release = new Release();
//test with empty string params
$expected = "name like '%'";
$actual = $release->build_generic_where_clause('');
$this->assertSame($expected, $actual);
//test with valid string params
$expected = "name like '%'";
$actual = $release->build_generic_where_clause('test');
$this->assertSame($expected, $actual);
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:12,代码来源:ReleaseTest.php
示例5: createTagsEdit
private function createTagsEdit()
{
//Suppression d'un tag
$sTags = '';
foreach ($this->oRelease->getTags() as $iTagId => $oRegex) {
$oButton = new View('button');
$oButton->addData('link', 'index.php?p=modrelease&a=deletetag&id=' . $this->oRelease->getId() . '&tag=' . $iTagId);
$oButton->addData('icon', 'fa-times');
$oButton->addData('style', 'info');
$oButton->addData('text', $oRegex->getName());
$oButton->create();
$sTags .= $oButton->getCode() . ' ';
}
//Ajout d'un tag
$aRegex = Regex::getSelectRegex();
$oPopupAdd = new View('popup');
$oPopupAdd->addData('id', 'addtag');
$oPopupAdd->addData('buttonstyle', 'btn-success');
$oPopupAdd->addData('buttonicon', 'fa-plus');
$oPopupAdd->addData('buttontext', 'Ajouter');
$oPopupAdd->addData('title', 'Ajouter un tag');
$oFormAdd = new FormGenerator();
$oFormAdd->setAction('index.php?p=modrelease&a=addtag&id=' . $this->oRelease->getId());
$oFormAdd->addSelect('Tag', 'tag', $aRegex);
$oFormAdd->create();
$oPopupAdd->addData('content', $oFormAdd->getCode());
$oPopupAdd->create();
$sTags .= $oPopupAdd->getCode();
$this->oView->addData('tagsdelete', $sTags);
}
开发者ID:Jatax,项目名称:TKS,代码行数:30,代码来源:modrelease.controller.php
示例6: parse
/**
* @return Release
*/
public function parse()
{
$changelog = file('ChangeLog', FILE_IGNORE_NEW_LINES);
$in_plugins = false;
$section = null;
$release = null;
foreach ($changelog as $line) {
if (strpos($line, 'Version ') === 0) {
if ($section) {
break;
}
$release = Release::buildFromChangeLog($this->tuleap_version, $line);
} elseif (preg_match('/^\\s*== /', $line)) {
$section = $release->addSectionFromChangeLog($line);
} else {
if ($section && $line) {
if ($section->hasSubSections() && $line) {
$sub_section = $section->addSectionFromChangeLog($line);
$this->extractChangelogOfPlugin($sub_section);
} else {
$section->addChange($line);
}
}
}
}
return $release;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:30,代码来源:ChangeLogReader.class.php
示例7: checkTags
/**
* Vérifie si un des tags est de la catégorie demandée
* @param int $p_iIdCat ID de la catégorie recherchée
* @return boolean
*/
private function checkTags($p_iIdCat)
{
foreach ($this->oRelease->getTags() as $oRegex) {
if ($oRegex->getCategorie() == $p_iIdCat) {
return true;
}
}
return false;
}
开发者ID:Jatax,项目名称:TKS,代码行数:14,代码来源:scrapper.model.php
示例8: renderRelease
/**
* @param Release $release
* @param bool $latest
*
* @return string
*/
private function renderRelease(Release $release, $latest = false)
{
$item = new \Text_Template(__DIR__ . '/../templates/item.html');
$manifest = '';
if (!empty($release->manifest())) {
$manifest = sprintf(' class="phar" data-title="Manifest" data-content="<ul>%s</ul>" data-placement="bottom" data-html="true"', implode('', array_map(function ($item) {
return '<li>' . $item . '</li>';
}, $release->manifest())));
}
$item->setVar(['domain' => $this->domain(), 'package' => $release->package(), 'version' => $release->version(), 'date' => $release->date(), 'size' => $release->size(), 'sha256' => $release->sha256(), 'strongOpen' => $latest ? '<strong>' : '', 'strongClose' => $latest ? '</strong>' : '', 'manifest' => $manifest]);
return $item->render();
}
开发者ID:matheusgomes17,项目名称:phar-site-generator,代码行数:18,代码来源:PageRenderer.php
示例9: addreleaseAction
public function addreleaseAction()
{
$form = new App_Form_Release();
$form->addElement('Submit', 'continue', array('label' => 'Save & Add Tracks', 'value' => 'continue'));
if (!empty($_POST) && $form->isValid($_POST)) {
//find the artistId for this account:
$release = new Release();
$release->title = $form->getValue('title');
$release->artistId = $this->_artist->id;
$release->publishDate = $form->getValue('publishDate');
$release->save();
$this->_flash->addMessage('Your release has been created.');
if ($form->getValue('continue') != null) {
$this->_redirector->gotoSimple('addtrack', null, null, array('releaseId' => $release->id));
}
$form->setDefaults(array('publishDate' => date('m/d/Y')));
}
$form->setMethod('post');
$form->setAction('/dashboard/catalog/addrelease');
$this->view->form = $form;
}
开发者ID:ajbrown,项目名称:bitnotion,代码行数:21,代码来源:CatalogController.php
示例10: add
/**
* @param Release $release
*/
public function add(Release $release)
{
$package = $release->package();
if (!isset($this->releases[$package])) {
$this->releases[$package] = ['latest' => ['all' => $release, $release->versionSeries() => $release], 'all' => []];
} else {
if (version_compare($release->version(), $this->releases[$package]['latest']['all']->version(), '>=')) {
$this->releases[$package]['latest']['all'] = $release;
}
if (!isset($this->releases[$package]['latest'][$release->versionSeries()]) || version_compare($release->version(), $this->releases[$package]['latest'][$release->versionSeries()]->version(), '>=')) {
$this->releases[$package]['latest'][$release->versionSeries()] = $release;
}
}
$this->releases[$package]['all'][] = $release;
$this->releases['all'][] = $release;
}
开发者ID:matheusgomes17,项目名称:phar-site-generator,代码行数:19,代码来源:ReleaseCollection.php
示例11: __construct
public function __construct($projectId, $releaseList, $content = null)
{
if (!is_array($releaseList)) {
$releaseList = array($releaseList);
}
parent::setUrl(new Url());
$this->setProjectId($projectId);
$this->setReleaseList($releaseList);
if ($content === null) {
$release = Release::getRelease($projectId, $releaseList[0]);
$content = $release->getCompleteName() . (count($releaseList) > 1 ? "+" : "");
}
$this->setContent($content);
}
开发者ID:KasaiDot,项目名称:Zero-Fansub-website,代码行数:14,代码来源:ReleaseLink.php
示例12: importRelease
private function importRelease(SmartSimpleXmlElement $releaseContainer)
{
$release = new Release();
$release->setPage(isset($releaseContainer['page']) ? (string) $releaseContainer['page'] : '/downloads.html');
$release->setDate(new Date((string) $releaseContainer->date));
$release->setVersion((string) $releaseContainer->version);
$release->setAbout($releaseContainer->about->p->toDomNode());
$this->addRelease($release, isset($releaseContainer['latest']) && 'true' == $releaseContainer['latest']);
}
开发者ID:phoebius,项目名称:phoebius.com,代码行数:9,代码来源:XmlReleaseSetBuilder.class.php
示例13: download
/**
* @param Release $release
*
* @return File
* @throws DownloadFailedException
* @throws VerificationFailedException
*/
public function download(Release $release)
{
$pharFile = $this->fileDownloader->download($release->getUrl());
$signatureFile = $this->fileDownloader->download($this->getSignatureUrl($release->getUrl()));
if (!$this->verifySignature($pharFile, $signatureFile)) {
throw new VerificationFailedException('Signature could not be verified');
}
if ($release->hasExpectedHash() && !$this->checksumService->verify($release->getExpectedHash(), $pharFile)) {
throw new VerificationFailedException(sprintf('Wrong checksum! Expected %s', $release->getExpectedHash()->asString()));
}
return $pharFile;
}
开发者ID:paul-schulleri,项目名称:phive,代码行数:19,代码来源:PharDownloader.php
示例14: getGlobalStats
/**
* Retourne les statistiques globales
* @return array
*/
public static function getGlobalStats()
{
$oMysqli = Database::getInstance();
$aStats = array();
// Récupération du nombre de releases
$iNbReleases = Release::getCount();
$aStats[] = array("text" => $iNbReleases, "icon" => "fa-film", "subtext" => "releases", "color" => "green");
// Récupération du nombre de torrents
$iNbTorrents = Torrent::getCount();
$aStats[] = array("text" => $iNbTorrents, "icon" => "fa-magnet", "subtext" => "torrents", "color" => "blue");
// Récupération du nombre d'utilisateur
$oResult = $oMysqli->query("SELECT COUNT(*) AS nbusers FROM tks_users");
$iNbUsers = $oResult->fetch_assoc()['nbusers'];
$aStats[] = array("text" => $iNbUsers, "icon" => "fa-users", "subtext" => "utilisateurs", "color" => "brown");
// Récupération du nombre de trackers
$oResult = $oMysqli->query("SELECT COUNT(*) AS nbtrackers FROM tks_trackers");
$iNbTrackers = $oResult->fetch_assoc()['nbtrackers'];
$aStats[] = array("text" => $iNbTrackers, "icon" => "fa-link", "subtext" => "trackers", "color" => "red");
return $aStats;
}
开发者ID:Jatax,项目名称:TKS,代码行数:24,代码来源:stats.model.php
示例15: exec
/**
* Exec multiple commands at once
*
* @param array<> $commands
* @return vouid
*/
public static function exec(array $commands)
{
foreach ($commands as $c) {
Release::split('─');
echo ' [exec] ' . $c . PHP_EOL;
Release::split('─');
$process = proc_open($c, array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);
if (is_resource($process)) {
fclose($pipes[0]);
while (!feof($pipes[1]) || !feof($pipes[2])) {
if ($out = fgets($pipes[1], 128)) {
echo ' │ ' . $out;
}
if ($err = fgets($pipes[2], 128)) {
echo ' ! ' . $err;
}
}
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);
}
}
Release::split('─');
}
开发者ID:wikidi,项目名称:release,代码行数:30,代码来源:release.php
示例16: addRelease
private function addRelease(Release $release)
{
$url = sprintf('https://%s/%s-%s.phar', $this->domain(), $release->package(), $release->version());
$releaseNode = $this->addElement('release');
$releaseNode->setAttribute('version', $release->version());
$releaseNode->setAttribute('url', $url);
$signatureNode = $this->addElement('signature');
$signatureNode->setAttribute('type', 'gpg');
$releaseNode->appendChild($signatureNode);
$hashNode = $this->addElement('hash');
$hashNode->setAttribute('type', 'sha-256');
$hashNode->setAttribute('value', $release->sha256());
$releaseNode->appendChild($hashNode);
$container = $this->getContainer($release->package());
if ($container->hasChildNodes()) {
$container->insertBefore($releaseNode, $container->firstChild);
} else {
$container->appendChild($releaseNode);
}
}
开发者ID:matheusgomes17,项目名称:phar-site-generator,代码行数:20,代码来源:PharIoRenderer.php
示例17: procede
public function procede()
{
if (!$this->oRequest->existParam('key')) {
throw new Error('Vous devez renseigner la clé.', 3003);
}
if ($this->oRequest->getParam('key', 'string') != Config::get('ingestkey')) {
throw new Error('La clé est invalide.', 3003);
}
//Ajoute du titre
$this->oView->addData('titre', 'Analyse des flux RSS');
//On récupère les éléments pour les statistiques
$iNbReleases = Release::getCount();
$iNbTorrents = Torrent::getCount();
$iStartTime = time();
//Traitement des Trackers
$aTrackers = Tracker::getTrackers();
//Ajout des flux
$aRssList = Rss::getFlux();
foreach ($aRssList as $oRss) {
$aTrackers[$oRss->getTrackerId()]->addFlux($oRss);
}
//Parsage des flux
$aResults = array();
foreach ($aTrackers as $oTracker) {
$aResults = array_merge($aResults, $oTracker->parseRss());
}
//Traitement des résultats
$oTable = new TableGenerator();
$oTable->setId(md5('Ingest'));
$oTable->addColumn('Tags');
$oTable->addColumn('Tracker');
$oTable->addColumn('Release');
foreach ($aResults as $oResult) {
if (is_string($oResult)) {
Logger::log('ingest', $oResult);
$this->oView->addAlert($oResult, 'danger');
} else {
$oResult->store();
$sTags = '';
foreach ($oResult->getTags() as $oTag) {
$oTagView = new View('label');
$oTagView->addData('type', 'info');
$oTagView->addData('text', $oTag->getName());
$oTagView->create();
$sTags .= $oTagView->getCode() . ' ';
}
$oTable->addLine(array($sTags, $aTrackers[$oResult->getTracker()]->getName(), $oResult->getReleaseName()));
}
}
//Statistiques
$iNewReleases = Release::getCount() - $iNbReleases;
$iNewTorrents = Torrent::getCount() - $iNbTorrents;
Stats::storeIngestStats($iNewReleases, $iNewTorrents, date("Y-m-j G:i:s", $iStartTime));
//Enregistrement de la dernière date de vérification
Rss::updateLastCheck(date("Y-m-j G:i:s", $iStartTime));
Logger::log('ingest', $iNewReleases . ' nouvelles releases et ' . $iNewTorrents . ' nouveaux torrents.');
$oTable->setBottom($iNewReleases . ' nouvelles releases et ' . $iNewTorrents . ' nouveaux torrents.');
$oTable->create();
$this->oView->addData('content', $oTable->getCode());
$this->oView->Create();
}
开发者ID:Jatax,项目名称:TKS,代码行数:61,代码来源:ingest.controller.php
示例18: catch
if (count($item) == 1) {
$email_details = Support::getEmailDetails(Email_Account::getAccountByEmail($item[0]), $item[0]);
$tpl->assign(array('issue_summary' => $email_details['sup_subject'], 'issue_description' => $email_details['seb_body']));
// also auto pre-fill the customer contact text fields
if (CRM::hasCustomerIntegration($prj_id)) {
$sender_email = Mail_Helper::getEmailAddress($email_details['sup_from']);
try {
$contact = $crm->getContactByEmail($sender_email);
$tpl->assign('contact_details', $contact->getDetails());
} catch (CRMException $e) {
}
}
}
}
}
$tpl->assign(array('cats' => Category::getAssocList($prj_id), 'priorities' => Priority::getAssocList($prj_id), 'severities' => Severity::getList($prj_id), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'releases' => Release::getAssocList($prj_id), 'custom_fields' => Custom_Field::getListByProject($prj_id, 'report_form'), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'max_attachment_bytes' => Attachment::getMaxAttachmentSize(true), 'field_display_settings' => Project::getFieldDisplaySettings($prj_id), 'groups' => Group::getAssocList($prj_id), 'products' => Product::getList(false)));
$prefs = Prefs::get($usr_id);
$tpl->assign('user_prefs', $prefs);
$tpl->assign('zones', Date_Helper::getTimezoneList());
if (Auth::getCurrentRole() == User::getRoleID('Customer')) {
$crm = CRM::getInstance(Auth::getCurrentProject());
$customer_contact_id = User::getCustomerContactID($usr_id);
$contact = $crm->getContact($customer_contact_id);
$customer_id = Auth::getCurrentCustomerID();
$customer = $crm->getCustomer($customer_id);
// TODOCRM: Pull contacts via ajax when user selects contract
$tpl->assign(array('customer_id' => $customer_id, 'contact_id' => $customer_contact_id, 'customer' => $customer, 'contact' => $contact));
}
$clone_iss_id = isset($_GET['clone_iss_id']) ? (int) $_GET['clone_iss_id'] : null;
if ($clone_iss_id && Access::canCloneIssue($clone_iss_id, $usr_id)) {
$tpl->assign(Issue::getCloneIssueTemplateVariables($clone_iss_id));
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:new.php
示例19: bulkUpdate
/**
* Method used to bulk update a list of issues
*
* @return boolean
*/
public static function bulkUpdate()
{
// check if user performing this chance has the proper role
if (Auth::getCurrentRole() < User::ROLE_MANAGER) {
return -1;
}
$items = (array) $_POST['item'];
$new_status_id = (int) $_POST['status'];
$new_release_id = (int) $_POST['release'];
$new_priority_id = (int) $_POST['priority'];
$new_category_id = (int) $_POST['category'];
foreach ($items as $issue_id) {
$issue_id = (int) $issue_id;
if (!self::canAccess($issue_id, Auth::getUserID())) {
continue;
}
if (self::getProjectID($issue_id) != Auth::getCurrentProject()) {
// make sure issue is not in another project
continue;
}
$issue_details = self::getDetails($issue_id);
$updated_fields = array();
// update assignment
if (count(@$_POST['users']) > 0) {
$users = (array) $_POST['users'];
// get who this issue is currently assigned too
$stmt = 'SELECT
isu_usr_id,
usr_full_name
FROM
{{%issue_user}},
{{%user}}
WHERE
isu_usr_id = usr_id AND
isu_iss_id = ?';
try {
$current_assignees = DB_Helper::getInstance()->getPair($stmt, array($issue_id));
} catch (DbException $e) {
return -1;
}
foreach ($current_assignees as $usr_id => $usr_name) {
if (!in_array($usr_id, $users)) {
self::deleteUserAssociation($issue_id, $usr_id, false);
}
}
$new_user_names = array();
$new_assignees = array();
foreach ($users as $usr_id) {
$usr_id = (int) $usr_id;
$new_user_names[$usr_id] = User::getFullName($usr_id);
// check if the issue is already assigned to this person
$stmt = 'SELECT
COUNT(*) AS total
FROM
{{%issue_user}}
WHERE
isu_iss_id=? AND
isu_usr_id=?';
$total = DB_Helper::getInstance()->getOne($stmt, array($issue_id, $usr_id));
if ($total > 0) {
continue;
} else {
$new_assignees[] = $usr_id;
// add the assignment
self::addUserAssociation(Auth::getUserID(), $issue_id, $usr_id, false);
Notification::subscribeUser(Auth::getUserID(), $issue_id, $usr_id, Notification::getAllActions());
}
}
$prj_id = Auth::getCurrentProject();
$usr_ids = self::getAssignedUserIDs($issue_id);
Workflow::handleAssignmentChange($prj_id, $issue_id, Auth::getUserID(), $issue_details, $usr_ids, false);
Notification::notifyNewAssignment($new_assignees, $issue_id);
$updated_fields['Assignment'] = History::formatChanges(implode(', ', $current_assignees), implode(', ', $new_user_names));
}
// update status
if ($new_status_id) {
$old_status_id = self::getStatusID($issue_id);
$res = self::setStatus($issue_id, $new_status_id, false);
if ($res == 1) {
$updated_fields['Status'] = History::formatChanges(Status::getStatusTitle($old_status_id), Status::getStatusTitle($new_status_id));
}
}
// update release
if ($new_release_id) {
$old_release_id = self::getRelease($issue_id);
$res = self::setRelease($issue_id, $new_release_id);
if ($res == 1) {
$updated_fields['Release'] = History::formatChanges(Release::getTitle($old_release_id), Release::getTitle($new_release_id));
}
}
// update priority
if ($new_priority_id) {
$old_priority_id = self::getPriority($issue_id);
$res = self::setPriority($issue_id, $new_priority_id);
if ($res == 1) {
//.........这里部分代码省略.........
开发者ID:dabielkabuto,项目名称:eventum,代码行数:101,代码来源:class.issue.php
示例20: __construct
public function __construct(Release $release, $forceDisplay = false)
{
$this->addComponent(new Anchor($release->getID()));
$link = new Link(null, $release->getCompleteName());
$title = new Title($link);
$title->setClass("title");
$this->addComponent($title);
if ($release->isReleased() || $forceDisplay) {
$this->setClass("released");
$link->setUrl(new Url());
$link->setOnClick("show('" . $release->getID() . "');return(false)");
$releaseContent = new SimpleBlockComponent();
$releaseContent->setID($release->getID());
$releaseContent->setClass("content");
$this->addComponent($releaseContent);
$previewImage = null;
if ($release->getPreviewUrl() !== null) {
try {
$pUrl = $release->getPreviewUrl()->toString();
$previewImage = new AutoFloatImage($pUrl);
$previewImage->setClass("previewImage");
$description = getimagesize($pUrl);
$width = $description[0];
if ($width < 150) {
$previewImage->makeRightFloating();
}
} catch (ErrorException $ex) {
$previewImage = Debug::createWarningTag("Preview introuvable");
}
}
$releaseContent->addComponent($previewImage);
$localizedName = new SimpleBlockComponent();
$localizedName->setClass("localizedName");
if ($release->getLocalizedTitle() !== null) {
$localizedName->addComponent(new Title("Nom de l'épisode FR"));
$localizedName->addComponent($release->getLocalizedTitle());
}
$releaseContent->addComponent($localizedName);
$originalName = new SimpleBlockComponent();
$originalName->setClass("originalName");
if ($release->getOriginalTitle() !== null) {
$originalName->addComponent(new Title("Nom original"));
$originalName->addComponent($release->getOriginalTitle());
}
$releaseContent->addComponent($originalName);
$synopsis = new SimpleBlockComponent();
$synopsis->setClass("synopsis");
if ($release->getSynopsis() !== null) {
$synopsis->addComponent(new Title("Synopsis"));
$synopsis->addComponent(Format::convertTextToHtml($release->getSynopsis()));
}
$releaseContent->addComponent($synopsis);
$comment = new SimpleBlockComponent();
$comment->setClass("comment");
if ($release->getComment() !== null) {
$comment->addComponent($release->getComment());
}
$releaseContent->addComponent($comment);
$staff = new SimpleBlockComponent();
$staff->setClass("staff");
$members = $release->getStaffMembers();
if (!empty($members)) {
$staff->addComponent(new Title("Staff"));
$strings = array();
foreach ($members as $member) {
$string = $member->getPseudo();
$roles = $release->getAssignmentFor($member->getID())->getRoles();
if (!empty($roles)) {
$strings2 = array();
foreach ($roles as $role) {
$strings2[] = $role->getName();
}
$string .= " : " . Format::arrayToString($strings2);
}
$strings[] = $string;
}
$staff->addComponent(format::arrayToString($strings, " | "));
}
$releaseContent->addComponent($staff);
if ($release->isLicensed()) {
$this->fillWithLicenseData($releaseContent, $release);
} else {
$this->fillWithDownloadData($releaseContent, $release);
}
$releaseContent->addComponent(new Pin());
$url = new Url();
$vars = $url->getQueryVars();
if (!isset($vars['show']) || !(strcmp($vars['show'], "*") == 0 || preg_match("#(,|^)" . preg_quote($release->getID()) . "(,|\$)#", $vars['show']) > 0)) {
$releaseContent->addComponent("<script type='text/javascript'>show('" . $release->getID() . "');</script>");
}
} else {
$this->setClass("notReleased");
$link->setUrl(new Url());
$link->addComponent(" - Non disponible");
}
}
开发者ID:KasaiDot,项目名称:Zero-Fansub-website,代码行数:96,代码来源:ReleaseComponent.php
注:本文中的Release类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论