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


PHP Issue::create方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $books = (array) json_decode(Input::all()['add_book_data']);
     DB::transaction(function () use($books) {
         $db_flag = false;
         $user_id = Auth::id();
         $book_title = Books::insertGetId(array('title' => $books['title'], 'author' => $books['author'], 'description' => $books['description'], 'category_id' => $books['category'], 'added_by' => $user_id));
         $newId = $book_title;
         if (!$book_title) {
             $db_flag = true;
         } else {
             $number_of_issues = $books['number'];
             for ($i = 0; $i < $number_of_issues; $i++) {
                 $issues = Issue::create(array('book_id' => $newId, 'added_by' => $user_id));
                 if (!$issues) {
                     $db_flag = true;
                 }
             }
         }
         if ($db_flag) {
             throw new Exception('Invalid update data provided');
         }
     });
     return "Books Added successfully to Database";
 }
开发者ID:linpar,项目名称:library-management-system,代码行数:30,代码来源:BooksController.php

示例2: doIssueForm

 public function doIssueForm($data, $form)
 {
     $issue = Issue::create();
     if ($issue->saveIssue($data['MemberID'], $data['Barcode'])) {
         return "success";
     } else {
         return "Error";
     }
 }
开发者ID:helpfulrobot,项目名称:howardgrigg-simple-library,代码行数:9,代码来源:CirculationPage.php

示例3: newIssue

 public function newIssue()
 {
     $issue_name = Input::get('issue_name');
     $already_created = Issue::where('issue_name', 'like', '%' . $issue_name . '%');
     $return = array('1' => '1', '2' => '2');
     if (!($already_created->count() > 0)) {
         if (isset($issue_name)) {
             $issue = Issue::create(array('issue_name' => $issue_name, 'created_by' => Auth::user()->id));
             $issue->save();
             return null;
         }
     } else {
         return Response::json(array('issue_name' => $already_created->first()->issue_name));
     }
     //return Response::json($return);
 }
开发者ID:netintelpro,项目名称:laravel-app,代码行数:16,代码来源:IssueController.php

示例4: actions

echo "Number of pending actions (should be one): ".count(ArticlePublish::GetPendingActions())."<br>";

// delete the article
echo "Deleting the article.<br>";
$newArticle->delete();

echo "Deleting the events.<br>";
$articlePublishObj->delete();
$articlePublishObj2->delete();
$articlePublishObj3->delete();

echo "<h2>ISSUE AUTOPUBLISH TESTS</h2>";
echo "Creating an issue...<br>";
$issueId = rand();
$issue = new Issue(1, 1, $issueId);
$issue->create($issueId);
$issue->fetch();
$issue->dumpToHtml();
$article1 = new Article(1, 1, $issueId, 1);
$article1->create('fastnews', 'issue schueduled publish test '.rand());
$article2 = new Article(1, 1, $issueId, 1);
$article2->create('fastnews', 'issue schueduled publish test '.rand());

// Create issue publish event
echo "Creating issue publish event...<br>";
$datetime = strftime("%Y-%m-%d %H:%M:00");
$issuePublishEvent = new IssuePublish(1, $issueId, 1, $datetime);
$issuePublishEvent->create();
$issuePublishEvent->setPublishAction('P');
$issuePublishEvent->setPublishArticlesAction('Y');
$issuePublishEvent->fetch();
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:test_autopublish.php

示例5: getGS

         }
     }
     $f_issue_name = Input::Get('f_issue_name', 'string', '');
     if ($f_issue_name != '') {
         $translationIssueObj->setName($f_issue_name);
     }
     $f_issue_urlname = Input::Get('f_issue_urlname', 'string', $issueObj->getUrlName());
     if ($f_issue_urlname == "") {
         camp_html_add_msg(getGS('You must fill in the $1 field.', '"' . getGS('New issue URL name') . '"'));
         camp_html_goto_page($backLink);
     }
     if (!camp_is_valid_url_name($f_issue_urlname)) {
         camp_html_add_msg(getGS('The $1 field may only contain letters, digits and underscore (_) character.', '"' . getGS('New issue URL name') . '"'));
         camp_html_goto_page($backLink);
     }
     $translationIssueObj->create($f_issue_urlname);
     if (!$translationIssueObj->exists()) {
         camp_html_add_msg(getGS('Unable to create the issue for translation $1.', $translationLanguageObj->getName()));
         camp_html_goto_page($backLink);
     }
 } else {
     $f_issue_name = Input::Get('f_issue_name', 'string', $issueObj->getName());
     $f_issue_urlname = Input::Get('f_issue_urlname', 'string', $issueObj->getUrlName());
     $translationIssueObj->update(array('Name' => $f_issue_name, 'ShortName' => $f_issue_urlname));
 }
 $f_section_number = $articleObj->getSectionNumber();
 $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number);
 if (!$sectionObj->exists()) {
     camp_html_display_error(getGS('No such section.'), $backLink);
     exit;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_translate.php

示例6: run

 public function run()
 {
     /* Users table */
     $usersData = array(array("username" => "administrator", "password" => Hash::make("password"), "email" => "admin@kblis.org", "name" => "kBLIS Administrator", "designation" => "Programmer"), array("username" => "external", "password" => Hash::make("password"), "email" => "admin@kblis.org", "name" => "External System User", "designation" => "Administrator", "image" => "/i/users/user-2.jpg"), array("username" => "lmorena", "password" => Hash::make("password"), "email" => "lmorena@kblis.org", "name" => "L. Morena", "designation" => "Lab Technologist", "image" => "/i/users/user-3.png"), array("username" => "abumeyang", "password" => Hash::make("password"), "email" => "abumeyang@kblis.org", "name" => "A. Abumeyang", "designation" => "Doctor"));
     foreach ($usersData as $user) {
         $users[] = User::create($user);
     }
     $this->command->info('users seeded');
     /* Specimen Types table */
     $specTypesData = array(array("name" => "Ascitic Tap"), array("name" => "Aspirate"), array("name" => "CSF"), array("name" => "Dried Blood Spot"), array("name" => "High Vaginal Swab"), array("name" => "Nasal Swab"), array("name" => "Plasma"), array("name" => "Plasma EDTA"), array("name" => "Pleural Tap"), array("name" => "Pus Swab"), array("name" => "Rectal Swab"), array("name" => "Semen"), array("name" => "Serum"), array("name" => "Skin"), array("name" => "Sputum"), array("name" => "Stool"), array("name" => "Synovial Fluid"), array("name" => "Throat Swab"), array("name" => "Urethral Smear"), array("name" => "Urine"), array("name" => "Vaginal Smear"), array("name" => "Water"), array("name" => "Whole Blood"));
     foreach ($specTypesData as $specimenType) {
         $specTypes[] = SpecimenType::create($specimenType);
     }
     $this->command->info('specimen_types seeded');
     /* Test Categories table - These map on to the lab sections */
     $test_categories = TestCategory::create(array("name" => "PARASITOLOGY", "description" => ""));
     $lab_section_microbiology = TestCategory::create(array("name" => "MICROBIOLOGY", "description" => ""));
     $this->command->info('test_categories seeded');
     /* Measure Types */
     $measureTypes = array(array("id" => "1", "name" => "Numeric Range"), array("id" => "2", "name" => "Alphanumeric Values"), array("id" => "3", "name" => "Autocomplete"), array("id" => "4", "name" => "Free Text"));
     foreach ($measureTypes as $measureType) {
         MeasureType::create($measureType);
     }
     $this->command->info('measure_types seeded');
     /* Measures table */
     $measureBSforMPS = Measure::create(array("measure_type_id" => "2", "name" => "BS for mps", "unit" => ""));
     $measure1 = Measure::create(array("measure_type_id" => "2", "name" => "Grams stain", "unit" => ""));
     $measure2 = Measure::create(array("measure_type_id" => "2", "name" => "SERUM AMYLASE", "unit" => ""));
     $measure3 = Measure::create(array("measure_type_id" => "2", "name" => "calcium", "unit" => ""));
     $measure4 = Measure::create(array("measure_type_id" => "2", "name" => "SGOT", "unit" => ""));
     $measure5 = Measure::create(array("measure_type_id" => "2", "name" => "Indirect COOMBS test", "unit" => ""));
     $measure6 = Measure::create(array("measure_type_id" => "2", "name" => "Direct COOMBS test", "unit" => ""));
     $measure7 = Measure::create(array("measure_type_id" => "2", "name" => "Du test", "unit" => ""));
     MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "No mps seen", "interpretation" => "Negative"));
     MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "+", "interpretation" => "Positive"));
     MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "++", "interpretation" => "Positive"));
     MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "+++", "interpretation" => "Positive"));
     MeasureRange::create(array("measure_id" => $measure1->id, "alphanumeric" => "Negative"));
     MeasureRange::create(array("measure_id" => $measure1->id, "alphanumeric" => "Positive"));
     MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "Low"));
     MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "High"));
     MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "Normal"));
     MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "High"));
     MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "Low"));
     MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "Normal"));
     MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "High"));
     MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "Low"));
     MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "Normal"));
     MeasureRange::create(array("measure_id" => $measure5->id, "alphanumeric" => "Positive"));
     MeasureRange::create(array("measure_id" => $measure5->id, "alphanumeric" => "Negative"));
     MeasureRange::create(array("measure_id" => $measure6->id, "alphanumeric" => "Positive"));
     MeasureRange::create(array("measure_id" => $measure6->id, "alphanumeric" => "Negative"));
     MeasureRange::create(array("measure_id" => $measure7->id, "alphanumeric" => "Positive"));
     MeasureRange::create(array("measure_id" => $measure7->id, "alphanumeric" => "Negative"));
     $measures = array(array("measure_type_id" => "1", "name" => "URIC ACID", "unit" => "mg/dl"), array("measure_type_id" => "4", "name" => "CSF for biochemistry", "unit" => ""), array("measure_type_id" => "4", "name" => "PSA", "unit" => ""), array("measure_type_id" => "1", "name" => "Total", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Alkaline Phosphate", "unit" => "u/l"), array("measure_type_id" => "1", "name" => "Direct", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Total Proteins", "unit" => ""), array("measure_type_id" => "4", "name" => "LFTS", "unit" => "NULL"), array("measure_type_id" => "1", "name" => "Chloride", "unit" => "mmol/l"), array("measure_type_id" => "1", "name" => "Potassium", "unit" => "mmol/l"), array("measure_type_id" => "1", "name" => "Sodium", "unit" => "mmol/l"), array("measure_type_id" => "4", "name" => "Electrolytes", "unit" => ""), array("measure_type_id" => "1", "name" => "Creatinine", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Urea", "unit" => "mg/dl"), array("measure_type_id" => "4", "name" => "RFTS", "unit" => ""), array("measure_type_id" => "4", "name" => "TFT", "unit" => ""));
     foreach ($measures as $measure) {
         Measure::create($measure);
     }
     $measureGXM = Measure::create(array("measure_type_id" => "4", "name" => "GXM", "unit" => ""));
     $measureBG = Measure::create(array("measure_type_id" => "2", "name" => "Blood Grouping", "unit" => ""));
     MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "O-"));
     MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "O+"));
     MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "A-"));
     MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "A+"));
     MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "B-"));
     MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "B+"));
     MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "AB-"));
     MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "AB+"));
     $measureHB = Measure::create(array("measure_type_id" => Measure::NUMERIC, "name" => "HB", "unit" => "g/dL"));
     $measuresUrinalysisData = array(array("measure_type_id" => "4", "name" => "Urine microscopy", "unit" => ""), array("measure_type_id" => "4", "name" => "Pus cells", "unit" => ""), array("measure_type_id" => "4", "name" => "S. haematobium", "unit" => ""), array("measure_type_id" => "4", "name" => "T. vaginalis", "unit" => ""), array("measure_type_id" => "4", "name" => "Yeast cells", "unit" => ""), array("measure_type_id" => "4", "name" => "Red blood cells", "unit" => ""), array("measure_type_id" => "4", "name" => "Bacteria", "unit" => ""), array("measure_type_id" => "4", "name" => "Spermatozoa", "unit" => ""), array("measure_type_id" => "4", "name" => "Epithelial cells", "unit" => ""), array("measure_type_id" => "4", "name" => "ph", "unit" => ""), array("measure_type_id" => "4", "name" => "Urine chemistry", "unit" => ""), array("measure_type_id" => "4", "name" => "Glucose", "unit" => ""), array("measure_type_id" => "4", "name" => "Ketones", "unit" => ""), array("measure_type_id" => "4", "name" => "Proteins", "unit" => ""), array("measure_type_id" => "4", "name" => "Blood", "unit" => ""), array("measure_type_id" => "4", "name" => "Bilirubin", "unit" => ""), array("measure_type_id" => "4", "name" => "Urobilinogen Phenlpyruvic acid", "unit" => ""), array("measure_type_id" => "4", "name" => "pH", "unit" => ""));
     foreach ($measuresUrinalysisData as $measureU) {
         $measuresUrinalysis[] = Measure::create($measureU);
     }
     $measuresWBCData = array(array("measure_type_id" => Measure::NUMERIC, "name" => "WBC", "unit" => "x10³/µL"), array("measure_type_id" => Measure::NUMERIC, "name" => "Lym", "unit" => "L"), array("measure_type_id" => Measure::NUMERIC, "name" => "Mon", "unit" => "*"), array("measure_type_id" => Measure::NUMERIC, "name" => "Neu", "unit" => "*"), array("measure_type_id" => Measure::NUMERIC, "name" => "Eos", "unit" => ""), array("measure_type_id" => Measure::NUMERIC, "name" => "Baso", "unit" => ""));
     foreach ($measuresWBCData as $value) {
         $measuresWBC[] = Measure::create($value);
     }
     $measureRangesWBC = array(array("measure_id" => $measuresWBC[0]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 4, "range_upper" => 11), array("measure_id" => $measuresWBC[1]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 1.5, "range_upper" => 4), array("measure_id" => $measuresWBC[2]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0.1, "range_upper" => 9), array("measure_id" => $measuresWBC[3]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 2.5, "range_upper" => 7), array("measure_id" => $measuresWBC[4]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0, "range_upper" => 6), array("measure_id" => $measuresWBC[5]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0, "range_upper" => 2));
     foreach ($measureRangesWBC as $value) {
         MeasureRange::create($value);
     }
     $this->command->info('measures seeded');
     /* Test Types table */
     $testTypeBS = TestType::create(array("name" => "BS for mps", "test_category_id" => $test_categories->id, "orderable_test" => 1));
     $testTypeStoolCS = TestType::create(array("name" => "Stool for C/S", "test_category_id" => $lab_section_microbiology->id));
     $testTypeGXM = TestType::create(array("name" => "GXM", "test_category_id" => $test_categories->id));
     $testTypeHB = TestType::create(array("name" => "HB", "test_category_id" => $test_categories->id, "orderable_test" => 1));
     $testTypeUrinalysis = TestType::create(array("name" => "Urinalysis", "test_category_id" => $test_categories->id));
     $testTypeWBC = TestType::create(array("name" => "WBC", "test_category_id" => $test_categories->id));
     $this->command->info('test_types seeded');
     /* TestType Measure table */
     TestTypeMeasure::create(array("test_type_id" => $testTypeBS->id, "measure_id" => $measureBSforMPS->id));
     TestTypeMeasure::create(array("test_type_id" => $testTypeGXM->id, "measure_id" => $measureGXM->id));
     TestTypeMeasure::create(array("test_type_id" => $testTypeGXM->id, "measure_id" => $measureBG->id));
     TestTypeMeasure::create(array("test_type_id" => $testTypeHB->id, "measure_id" => $measureHB->id));
     foreach ($measuresUrinalysis as $value) {
         TestTypeMeasure::create(array("test_type_id" => $testTypeUrinalysis->id, "measure_id" => $value->id));
     }
     foreach ($measuresWBC as $value) {
         TestTypeMeasure::create(array("test_type_id" => $testTypeWBC->id, "measure_id" => $value->id));
//.........这里部分代码省略.........
开发者ID:BaobabHealthTrust,项目名称:iBLIS,代码行数:101,代码来源:TestDataSeeder.php

示例7: createIssue

 /**
  * Create an issue of a product.
  * @param  Product $product           - the product which the issue points to
  * @param  String  $productVersion    - the version of the product where the issue found
  * @param  String  $issueCategorySlug - the unique slug of the category of the issue
  * @param  User    $hunter            - the user who found the issue
  * @param  String  $issueTitle        - the title of the issue
  * @param  String  $issueDescription  - the description of the issue
  * @param  boolean $isTokenValid      - whether the CSRF token is correct
  * @return an array with data validation result
  */
 public function createIssue($product, $productVersion, $issueCategorySlug, $hunter, $issueTitle, $issueDescription, $isTokenValid)
 {
     $issueCategory = $this->getIssueCategoryObjectUsingSlug($issueCategorySlug);
     $result = array('isSuccessful' => false, 'isProductExists' => $product != NULL, 'isProductVersionEmpty' => empty($productVersion), 'isProductVersionLegal' => $this->isProductVersionLegal($productVersion), 'isIssueCategoryEmpty' => $issueCategory == NULL, 'isUserLoggedIn' => $hunter != NULL, 'isIssueTitleEmpty' => empty($issueTitle), 'isIssueTitleLegal' => $this->isIssueTitleLegal($issueTitle), 'isDescriptionEmpty' => empty($issueDescription), 'isTokenValid' => $isTokenValid);
     $result['isSuccessful'] = $result['isProductExists'] && !$result['isProductVersionEmpty'] && $result['isProductVersionLegal'] && !$result['isIssueCategoryEmpty'] && $result['isUserLoggedIn'] && !$result['isIssueTitleEmpty'] && $result['isIssueTitleLegal'] && !$result['isDescriptionEmpty'] && $result['isTokenValid'];
     if ($result['isSuccessful']) {
         $issueStatus = IssueStatus::findFirst("issue_status_slug = 'unconfirmed'");
         $issue = new Issue();
         $issue->setProduct($product);
         $issue->setProductVersion($productVersion);
         $issue->setIssueCategory($issueCategory);
         $issue->setIssueStatus($issueStatus);
         $issue->setHunter($hunter);
         $issue->setIssueTitle($issueTitle);
         $issue->setIssueDescription($issueDescription);
         if (!$issue->create()) {
             $result['isSuccessful'] = false;
         } else {
             $result['issueId'] = $issue->getIssueId();
         }
     }
     return $result;
 }
开发者ID:kelliany,项目名称:TestZilla,代码行数:34,代码来源:IssueService.php

示例8: __copy

	/**
	 * Copy this issue and all sections.
	 * @param int $p_destPublicationId
	 * @param int $p_destIssueId
	 * @param int $p_destLanguageId
	 * @return Issue
	 */
	private function __copy($p_destPublicationId, $p_destIssueId, $p_destLanguageId)
	{
        // Copy the issue
        $newIssue = new Issue($p_destPublicationId, $p_destLanguageId, $p_destIssueId);
        $columns = array();
        $columns['Name'] = mysql_real_escape_string($this->getName());
    	$columns['IssueTplId'] = $this->m_data['IssueTplId'];
    	$columns['SectionTplId'] = $this->m_data['SectionTplId'];
    	$columns['ArticleTplId'] = $this->m_data['ArticleTplId'];
        $created = $newIssue->create($p_destIssueId, $columns);
        if ($created) {
	    // Copy the sections in the issue
            $sections = Section::GetSections($this->m_data['IdPublication'],
                							 $this->m_data['Number'],
                							 $this->m_data['IdLanguage']);
            foreach ($sections as $section) {
                $section->copy($p_destPublicationId, $p_destIssueId, $p_destLanguageId, null, false);
            }
            return $newIssue;
        } else {
            return null;
        }
	} // fn __copy
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:Issue.php

示例9: underscore

if (!camp_is_valid_url_name($f_url_name)) {
    camp_html_add_msg(getGS('The $1 field may only contain letters, digits and underscore (_) character.', '</B>' . getGS('URL Name') . '</B>'));
}
if (empty($f_issue_number) || !is_numeric($f_issue_number) || $f_issue_number <= 0) {
    camp_html_add_msg(getGS('You must fill in the $1 field.', '<B>' . getGS('Number') . '</B>'));
}
if ($errorMsg = camp_is_issue_conflicting($f_publication_id, $f_issue_number, $f_language_id, $f_url_name, false)) {
    camp_html_add_msg($errorMsg);
}
if (camp_html_has_msgs()) {
    camp_html_goto_page($backLink);
}
$lastIssueObj = Issue::GetLastCreatedIssue($f_publication_id);
$publicationObj = new Publication($f_publication_id);
$newIssueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number);
$created = $newIssueObj->create($f_url_name, array('Name' => $f_issue_name));
//add default theme
$resourceId = new ResourceId('Publication/Edit');
$syncRsc = $resourceId->getService(ISyncResourceService::NAME);
$outputService = $resourceId->getService(IOutputService::NAME);
$outputSettingIssueService = $resourceId->getService(IOutputSettingIssueService::NAME);
$issueService = $resourceId->getService(IIssueService::NAME);
$themeManagementService = $resourceId->getService(IThemeManagementService::NAME_1);
$publicationThemes = $themeManagementService->getThemes($publicationObj->getPublicationId());
if (is_array($publicationThemes) && count($publicationThemes) > 0) {
    if ($lastIssueObj instanceof Issue) {
        $outSetIssues = $outputSettingIssueService->findByIssue($lastIssueObj->getIssueId());
        $themePath = null;
        if (count($outSetIssues) > 0) {
            $outSetIssue = $outSetIssues[0];
            $themePath = $outSetIssue->getThemePath()->getPath();
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_add_new.php

示例10: move_to_issue

	/**
	 * move the proposal to a different issue
	 *
	 * @param integer $new_issue_id
	 */
	public function move_to_issue($new_issue_id) {

		DB::transaction_start();
		$this->read();

		if ( !$this->allowed_move_to_issue() ) {
			DB::transaction_rollback();
			warning(_("Moving this proposal is not allowed anymore."));
			redirect();
		};

		$options = $this->options_move_to_issue();
		if (!isset($options[$new_issue_id])) {
			DB::transaction_rollback();
			warning(_("The selected option is not available."));
			redirect();
		}

		$old_issue = $this->issue();

		if ($new_issue_id) {
			$new_issue = new Issue($new_issue_id);
			if (!$new_issue->id) {
				DB::transaction_rollback();
				warning(_("The issue does not exist."));
				redirect();
			}
		} else {
			// create a new empty issue
			$new_issue = new Issue;
			$new_issue->area   = $old_issue->area;
			$new_issue->period = $old_issue->period;
			$new_issue->state  = $old_issue->state;
			// If the old issue reached offline voting, the new issue gets offline voting unseen the number of offline voting demanders.
			$new_issue->votingmode_reached = $old_issue->votingmode_reached;
			$new_issue->debate_started = $old_issue->debate_started;
			$new_issue->create();
		}

		$this->issue = $new_issue->id;

		if ( ! $this->update(['issue']) ) {
			DB::transaction_rollback();
			return;
		}

		DB::transaction_commit();

		// cancel empty issue
		if ( ! $old_issue->proposals() ) $old_issue->cancel();

		// send notification
		$notification = new Notification("proposal_moved");
		$notification->issue_old = $old_issue;
		$notification->issue     = $new_issue;
		$notification->proposal  = $this;
		// votingmode voters of both issues
		$sql = "SELECT DISTINCT member FROM votingmode_token WHERE issue=".intval($old_issue->id)." OR issue=".intval($new_issue->id);
		$recipients = DB::fetchfieldarray($sql);
		// supporters and proponents of the proposal
		$sql = "SELECT DISTINCT member FROM supporter WHERE proposal=".intval($this->id);
		$recipients = array_unique(array_merge($recipients, DB::fetchfieldarray($sql)));
		$notification->send($recipients);

	}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:70,代码来源:Proposal.php

示例11: __copy

 /**
  * Copy this issue and all sections.
  * @param int $p_destPublicationId
  * @param int $p_destIssueId
  * @param int $p_destLanguageId
  * @return Issue
  */
 private function __copy($p_destPublicationId, $p_destIssueId, $p_destLanguageId)
 {
     global $g_ado_db;
     // Copy the issue
     $newIssue = new Issue($p_destPublicationId, $p_destLanguageId, $p_destIssueId);
     $columns = array();
     $columns['Name'] = $g_ado_db->escape($this->getName());
     $columns['IssueTplId'] = $this->m_data['IssueTplId'];
     $columns['SectionTplId'] = $this->m_data['SectionTplId'];
     $columns['ArticleTplId'] = $this->m_data['ArticleTplId'];
     $created = $newIssue->create($p_destIssueId, $columns);
     if ($created) {
         // Copy the sections in the issue
         $sections = Section::GetSections($this->m_data['IdPublication'], $this->m_data['Number'], $this->m_data['IdLanguage']);
         $queryStr = "SELECT id FROM Issues WHERE IdPublication={$p_destPublicationId} AND Number={$p_destIssueId} AND IdLanguage={$p_destLanguageId}";
         $issueId = $g_ado_db->GetOne($queryStr);
         $issue = $this->getIssueService()->findById($issueId);
         $outputSettings = $this->getOutputSettingIssueService()->findByIssue($this->getIssueId());
         foreach ($outputSettings as $outSet) {
             $newOutSet = new OutputSettingsIssue();
             $outSet->copyTo($newOutSet);
             $newOutSet->setIssue($issue);
             $this->getOutputSettingIssueService()->insert($newOutSet);
         }
         foreach ($sections as $section) {
             $section->copy($p_destPublicationId, $p_destIssueId, $p_destLanguageId, null, false);
         }
         return $newIssue;
     } else {
         return null;
     }
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:39,代码来源:Issue.php

示例12: run

 public function run()
 {
     /* Users table 
             $usersData = array(
                 array(
                     "username" => "administrator", "password" => Hash::make("password"), "email" => "admin@kblis.org",
                     "name" => "kBLIS Administrator", "designation" => "Programmer"
                 ),
                 
             );
     
             foreach ($usersData as $user)
             {
                 $users[] = User::create($user);
             }
             $this->command->info('users seeded');
             
             //Seed for suppliers
             $supplier = Supplier::create(
                 array(
                     "name" => "UNICEF",
                     "phone_no" => "0775112233",
                     "email" => "uni@unice.org",
                     "physical_address" => "un-hqtr"
     
                 )
             );
             $this->command->info('Suppliers table seeded');
             */
     //Seed for metrics
     $metric = Metric::create(array("name" => "mg", "description" => "milligram"));
     $this->command->info('Metrics table seeded');
     //Seed for commodities
     $commodity = Commodity::create(array("name" => "Ampicillin", "description" => "Capsule 250mg", "metric_id" => $metric->id, "unit_price" => "500", "item_code" => "no clue", "storage_req" => "no clue", "min_level" => "100000", "max_level" => "400000"));
     $this->command->info('Commodities table seeded');
     //Seed for receipts
     $receipt = Receipt::create(array("commodity_id" => $commodity->id, "supplier_id" => $supplier->id, "quantity" => "130000", "batch_no" => "002720", "expiry_date" => "2018-10-14", "user_id" => "1"));
     $this->command->info('Receipts table seeded');
     //Seed for Top Up Request
     $topUpRequest = TopupRequest::create(array("commodity_id" => $commodity->id, "test_category_id" => 1, "order_quantity" => "1500", "user_id" => 1, "remarks" => "-"));
     $this->command->info('Top Up Requests table seeded');
     //Seed for Issues
     Issue::create(array("receipt_id" => $receipt->id, "topup_request_id" => $topUpRequest->id, "quantity_issued" => "1700", "issued_to" => 1, "user_id" => 1, "remarks" => "-"));
     $this->command->info('Issues table seeded');
     //Seed for diseases
     $malaria = Disease::create(array('name' => "Malaria"));
     $typhoid = Disease::create(array('name' => "Typhoid"));
     $dysentry = Disease::create(array('name' => "Shigella Dysentry"));
     $this->command->info("Dieases table seeded");
     $reportDiseases = array(array("test_type_id" => $testTypeBS->id, "disease_id" => $malaria->id), array("test_type_id" => $test_types_salmonella->id, "disease_id" => $typhoid->id), array("test_type_id" => $testTypeStoolCS->id, "disease_id" => $dysentry->id));
     foreach ($reportDiseases as $reportDisease) {
         ReportDisease::create($reportDisease);
     }
     $this->command->info("Report Disease table seeded");
     //Seeding for QC
     $lots = array(array('number' => '0001', 'description' => 'First lot', 'expiry' => date('Y-m-d H:i:s', strtotime("+6 months")), 'instrument_id' => 1), array('number' => '0002', 'description' => 'Second lot', 'expiry' => date('Y-m-d H:i:s', strtotime("+7 months")), 'instrument_id' => 1));
     foreach ($lots as $lot) {
         $lot = Lot::create($lot);
     }
     $this->command->info("Lot table seeded");
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:61,代码来源:ITECHDatabaseSeeder.php


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