本文整理汇总了PHP中Project::setStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::setStatus方法的具体用法?PHP Project::setStatus怎么用?PHP Project::setStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::setStatus方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processCreate
protected function processCreate(sfWebRequest $request, ProjectFormCustom $form)
{
$form->bind($request->getParameter($form->getName()));
if ($form->isValid()) {
$values = $form->getValues();
// Slugify name, and check if slug generated does not already exist and generate a new one if needed
if (empty($values['name_slug'])) {
$slug = MiscUtils::slugify($values['name']);
} else {
$slug = $values['name_slug'];
}
$size = 1;
while (Doctrine_Core::getTable("Project")->checkSlugForProject(NULL, $slug, true)) {
$slug = MiscUtils::slugify($values['name']) . substr(microtime(), -$size);
$size++;
}
// Create the project into database
$projectObject = new Project();
$projectObject->setName($values['name']);
$projectObject->setDescription($values['description']);
$projectObject->setUserId($values['user_id']);
$projectObject->setCreatedAt($values['created_at']);
$projectObject->setStatus($values['status']);
$projectObject->setSecurityLevel($values['security_level']);
$projectObject->setNameSlug($slug);
$projectObject->save();
// Get the project's id
$projectId = $projectObject->getId();
// Create a new relationship between projects, products and project groups for each checked form's product
foreach ($values['product'] as $product) {
$ptpObject = new ProjectToProduct();
$ptpObject->setProjectGroupId($values['group']);
$ptpObject->setProjectId($projectId);
$ptpObject->setProductId($product);
$ptpObject->save();
}
if ($request->hasParameter('_save_and_add')) {
$this->getUser()->setFlash('notice', $notice . ' You can add another one below.');
$this->redirect('@project_new');
} else {
$this->getUser()->setFlash('notice', $notice);
$this->redirect(array('sf_route' => 'project_edit', 'sf_subject' => $projectObject));
}
} else {
$this->getUser()->setFlash('error', 'The item has not been saved due to some errors.', false);
}
}
示例2: addProject
function addProject()
{
$response = new Response();
try {
$projectName = $this->input->post("project-name");
$subdivision = $this->input->post("sub-division");
$budget = $this->input->post("project-budget");
$schemeId = $this->input->post("scheme");
$project = new Project();
$project->setCreated(new DateTime());
$project->setName($projectName);
$project->setStatus(Project::PROJECT_ADMIN_APPROVAL);
$project->setBudget($budget);
$project->setScheme($this->findById("Scheme", $schemeId));
$subdivision = $this->findById("Subdivision", $subdivision);
$project->setSubDivision($subdivision);
$this->save($project);
} catch (Exception $e) {
$response->setStatus(false);
$response->setErrorMessage($e->getMessage());
}
$this->output->set_content_type('application/json')->set_output(json_encode($response));
}
示例3: add
/**
* Process add project form
*
* @param void
* @return null
*/
function add()
{
$this->wireframe->print_button = false;
if ($this->request->isApiCall() && !$this->request->isSubmitted()) {
$this->httpError(HTTP_ERR_BAD_REQUEST);
}
// if
if (!Project::canAdd($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$project_data = $this->request->post('project');
if (!is_array($project_data)) {
$project_data = array('leader_id' => $this->logged_user->getId(), 'default_visibility' => VISIBILITY_PRIVATE);
}
// if
$this->smarty->assign('project_data', $project_data);
if ($this->request->isSubmitted()) {
db_begin_work();
$this->active_project = new Project();
// just in case
$this->active_project->setAttributes($project_data);
$this->active_project->setType(PROJECT_TYPE_NORMAL);
$this->active_project->setStatus(PROJECT_STATUS_ACTIVE);
$leader = null;
if ($this->active_project->getLeaderId()) {
$leader = Users::findById($this->active_project->getLeaderId());
if (instance_of($leader, 'User')) {
$this->active_project->setLeader($leader);
}
// if
}
// if
$project_template = null;
$project_template_id = array_var($project_data, 'project_template_id');
if ($project_template_id) {
$project_template = Projects::findById($project_template_id);
}
// if
$save = $this->active_project->save($project_template);
if ($save && !is_error($save)) {
// Add user who created a project and leader
$this->active_project->addUser($this->logged_user, null, null);
if (instance_of($leader, 'User')) {
$this->active_project->addUser($leader, null, null);
}
// if
// Clone project template
if (instance_of($project_template, 'Project')) {
$project_template->copyItems($this->active_project);
} else {
// Auto assign users...
$users = Users::findAutoAssignUsers();
if (is_foreachable($users)) {
foreach ($users as $user) {
$this->active_project->addUser($user, $user->getAutoAssignRole(), $user->getAutoAssignPermissions());
}
// foreach
}
// if
// Create default categories
$category_definitions = array();
event_trigger('on_master_categories', array(&$category_definitions));
if (is_foreachable($category_definitions)) {
foreach ($category_definitions as $category_definition) {
$default_categories = $category_definition['value'];
if (!is_foreachable($default_categories)) {
$default_categories = array('General');
}
// if
foreach ($default_categories as $category_name) {
if (trim($category_name) != '') {
$category = new Category();
$category->log_activities = false;
// don't log stuff in DB
$category->setName($category_name);
$category->setProjectId($this->active_project->getId());
$category->setCreatedBy($this->logged_user);
$category->setState(STATE_VISIBLE);
$category->setVisibility(VISIBILITY_NORMAL);
$category->setModule($category_definition['module']);
$category->setController($category_definition['controller']);
$category->save();
}
// if
}
// foreach
}
// foreach
}
// if
}
// if
db_commit();
//.........这里部分代码省略.........
示例4: save
//.........这里部分代码省略.........
$proj->setBudget($_POST['amount']);
} else {
$proj->setBudget(NULL);
}
if (isset($_POST['requirement1'])) {
$proj->setRequirement($_POST['requirement1']);
} else {
$proj->setRequirement("");
}
if (isset($_POST['requirement2'])) {
$proj->setRequirement($_POST['requirement2']);
}
if (isset($_POST['requirement3'])) {
$proj->setRequirement($_POST['requirement3']);
}
if (isset($_POST['requirement4'])) {
$proj->setRequirement($_POST['requirement4']);
}
if (isset($_POST['requirement5'])) {
$proj->setRequirement($_POST['requirement5']);
}
if (isset($_POST['cb_volunteer'])) {
if (isset($_POST['number_volunteer'])) {
$proj->setVolunteer($_POST['number_volunteer']);
} else {
$proj->setVolunteer(1);
}
} else {
$proj->setVolunteer(0);
}
if (isset($_POST['cb_otherorg'])) {
if (isset($_POST['organization1'])) {
$proj->setOrganization($_POST['organization1']);
} else {
$proj->setOrganization("");
}
if (isset($_POST['organization2'])) {
$proj->setOrganization($_POST['organization2']);
}
if (isset($_POST['organization3'])) {
$proj->setOrganization($_POST['organization3']);
}
if (isset($_POST['organization4'])) {
$proj->setOrganization($_POST['organization4']);
}
if (isset($_POST['organization5'])) {
$proj->setOrganization($_POST['organization5']);
}
} else {
$proj->setOrganization("");
}
if (isset($_FILES['banner_image'])) {
if ($_FILES['banner_image']['name'] != "") {
$filename = $_FILES['banner_image']['name'];
$path = ROOT_PATH . "/profile/project_image/";
move_uploaded_file($_FILES['banner_image']['tmp_name'], $path . $filename);
$savepath = BASE_URL . "/profile/project_image/";
$proj->setBanner_image($savepath . $filename);
} else {
$filename = "default.jpg";
$savepath = BASE_URL . "/profile/project_image/";
$proj->setBanner_image($savepath . $filename);
}
} else {
$savepath = BASE_URL . "/profile/project_image/";
$proj->setBanner_image($savepath . "default.jpg");
}
if (isset($_FILES['project_proposal'])) {
if ($_FILES['project_proposal']['name'] != "") {
$filename = $_FILES['project_proposal']['name'];
$path = ROOT_PATH . "/profile/project_proposal/";
move_uploaded_file($_FILES['project_proposal']['tmp_name'], $path . $filename);
$savepath = BASE_URL . "/profile/project_proposal/";
$proj->setProject_proposal($savepath . $filename);
} else {
$filename = "default.docx";
$savepath = BASE_URL . "/profile/project_proposal/";
$proj->setProject_proposal($savepath . $filename);
}
} else {
$savepath = BASE_URL . "/profile/project_proposal/";
$proj->setProject_proposal($savepath . "default.docx");
}
if (isset($_POST['project_video'])) {
$string = $_POST['project_video'];
$search = '#(.*?)(?:href="https?://)?(?:www\\.)?(?:youtu\\.be/|youtube\\.com(?:/embed/|/v/|/watch?.*?v=))([\\w\\-]{10,12}).*#x';
$replace = 'http:/utube.com/embed/$2';
$url = preg_replace($search, $replace, $string);
$proj->setVideourl($url);
} else {
$proj->setVideourl("");
}
if (isset($_POST['details'])) {
$proj->setDetail($_POST['details']);
} else {
$proj->setDetail("");
}
$proj->setStatus(1);
$id = $this->projectrepository->insert($proj);
}
示例5: getAllProjects
public static function getAllProjects()
{
if (Project::$allProjects === null) {
$project = new Project("haganai", "Boku ha Tomodachi ga Sukunai");
$project->setOriginalName("Boku ha Tomodachi ga Sukunai");
$project->setAiringYear(2011);
$project->setStudio(Link::newWindowLink("http://www.haganai.net/", "Studio AIC"));
$project->setGenre("Comédie - Ecchi");
$project->setSynopsis("C'est bien connu, les otakus n'ont pas d'amis. Mais quand on n'en est pas un, ça ne veut pas dire pour autant qu'on en a. Si vous aussi vous avez du mal avec les autres, peut-être vous reconnaitrez-vous dans cette série. Sinon, vous pourrez toujours en profiter pleinement pour découvrir comment s'amuser quand on n'a pas d'amis... ou tout du moins quand on en est convaincus.");
$project->setDiscussionUrl("http://forum.zerofansub.net/t2053-Ton-avis-sur-Boku-wa-tomodachi-ga-sukunai.htm");
$project->setStatus(Project::RUNNING, null);
Project::$allProjects[] = $project;
$project = new Project("haganaioav", "Boku ha Tomodachi ga Sukunai OAV");
$project->setOriginalName("Boku ha Tomodachi ga Sukunai OAV");
$project->setAiringYear(2011);
$project->setStudio(Link::newWindowLink("http://www.anime-int.com/", "Studio AIC"));
$project->setGenre("Comédie - Ecchi");
$project->setSynopsis("Quand on a une bonne bande d'amis, on partage de bons moments ensemble. On organise des pique-niques, chacun apporte son repas, et tout le monde s'amuse avec entrain. Enfin ça, c'est ce qu'on fait quand on a des amis. Mais quand on n'en a pas, que fait-on ? Eh bien, certains essayent de faire comme si... et là, ça peut tourner au génocide. Attention à la crise de foie.");
$project->setDiscussionUrl("http://forum.zerofansub.net/t2053-Ton-avis-sur-Boku-wa-tomodachi-ga-sukunai.htm");
$project->setStatus(Project::FINISHED, null);
Project::$allProjects[] = $project;
$project = new Project("kodomo", "Kodomo no Jikan");
$project->setExternalSource(Link::newWindowLink("http://animeka.com/fansub/teams/zero.html", "Animeka"));
$project->setOriginalName("Kodomo no Jikan");
$project->setOfficialWebsite(Link::newWindowLink("http://www.kojika-anime.com/", "Kojika-anime.com"));
$project->setAiringYear(2007);
$project->setStudio(Link::newWindowLink("http://www.stbarcelona.com/", "Studio Barcelona"));
$project->setGenre("Comédie - Ecchi");
$project->setAuthor("Watashiya Kaworu");
$project->setSynopsis("M. Aoki Daisuke sensei est un tout nouvel instituteur en primaire et débute sa carrière dans une classe d'enfants a priori calme, mais il découvrira que même à neuf ans on peut être bien précoce. Il fera la rencontre de Rin Kokonoe, Kuro Kagami et Mimi Usa, trois jeunes filles de sa classe qui sont prêtes à lui apporter bien des soucis, surtout pour la petite Kokonoe. Cette dernière fera tout pour que son sensei chéri tombe amoureux d'elle, comme par exemple des pièges parfois osés, et rendra sa vie de nouvel instituteur très difficile. \nAu fil du temps, Aoki sensei découvrira que tout n'est pas toujours rose dans la vie de ses élèves et fera de son mieux pour les aider à surmonter les problèmes, même s'il met parfois en jeu son poste d'éducateur. Reste à voir dans quelles galères il se mettra, surtout avec le trio Kokonoe, Kagami et Usa.");
$project->setVosta('<a href="http://www.genjo-subs.net/" target="_blank">Genjo Subs</a> et <a href="http://loli-pop-subs.blogspot.com/" target="_blank">Loli-Pop-Subs</a>');
$project->setDiscussionUrl("http://forum.zerofansub.net/t252-Ton-avis-sur-Kodomo-no-Jikan.htm");
$project->setStatus(Project::FINISHED, null);
Project::$allProjects[] = $project;
$project = new Project("kodomooav", "Kodomo no Jikan OAV");
$project->setExternalSource(Link::newWindowLink("http://animeka.com/fansub/teams/zero.html", "Animeka"));
$project->setOriginalName("Kodomo no Jikan OVA");
$project->setOfficialWebsite(Link::newWindowLink("http://www.kojika-anime.com/", "Kojika-anime.com"));
$project->setAiringYear(2007);
$project->setStudio(Link::newWindowLink("http://www.stbarcelona.com/", "Studio Barcelona"));
$project->setGenre("Comédie - Ecchi");
$project->setAuthor("Watashiya Kaworu");
$project->setSynopsis("Rin, Kuro et Mimi sont trois adorables petites filles de 10 ans qui découvrent le monde des adultes... C'est l'anniversaire d'Aoki, leur instituteur mais aussi l'amoureux secret de Rin. Celle-ci tente donc de le séduire en lui offrant un cadeau... original.");
$project->setVosta('<a href="http://www.genjo-subs.net/" target="_blank">Genjo Subs</a>');
$project->setComment("Si vous souhaitez regarder l'OAV mais aussi la série, il est conseillé de regarder l'OAV entre l'épisode 5 et 6.\nSi vous voulez connaître rapidement la série, cet OAV résume bien et on peut le regarder sans voir la série. Mais c'est quand même mieux de regarder la série, évidemment ^^");
$project->setDiscussionUrl("http://forum.zerofansub.net/t251-Ton-avis-sur----Kodomo-no-Jikan-OAV.htm");
$project->setStatus(Project::FINISHED, null);
Project::$allProjects[] = $project;
$project = new Project("kodomo2", "Kodomo no Jikan ~ Ni Gakki");
$project->setExternalSource(Link::newWindowLink("http://animeka.com/fansub/teams/zero.html", "Animeka"));
$project->setOriginalName("Kodomo no Jikan ~Second Season~");
$project->setOfficialWebsite(Link::newWindowLink("http://www.kojika-anime.com/", "Kojika-anime.com"));
$project->setAiringYear(2009);
$project->setStudio(Link::newWindowLink("http://www.stbarcelona.com/", "Studio Barcelona"));
$project->setGenre("Comédie - Ecchi");
$project->setAuthor("Watashiya Kaworu");
$project->setVosta('<a href="http://loli-pop-subs.blogspot.com/" target="_blank">Loli-Pop-Subs</a>');
$project->setDiscussionUrl("http://forum.zerofansub.net/t358-Ton-avis-sur-Kodomo-no-Jikan-Saison-2.htm");
$project->setStatus(Project::FINISHED, null);
Project::$allProjects[] = $project;
$project = new Project("kodomonatsu", "Kodomo no Natsu Jikan");
$project->setExternalSource(Link::newWindowLink("http://animeka.com/fansub/teams/zero.html", "Animeka"));
$project->setOriginalName("Kodomo no Jikan - Kodomo no Natsu Jikan");
$project->setOfficialWebsite(Link::newWindowLink("http://www.kojika-anime.com/", "Kojika-anime.com"));
$project->setAiringYear(2011);
$project->setStudio(Link::newWindowLink("http://www.stbarcelona.com/", "Studio Barcelona"));
$project->setGenre("Comédie - Ecchi");
$project->setAuthor("Watashiya Kaworu");
$project->setSynopsis("Rin, Kuro et Mimi sont de retour dans un OAV Spécial de Kodomo no Jikan : Kodomo no Natsu Jikan ! Elles sont toutes les trois absolument adorables dans leurs maillots de bain d'été, en vacances avec Aoki et Houin.");
$project->setDiscussionUrl("http://forum.zerofansub.net/t252-Ton-avis-sur-Kodomo-no-Jikan.htm");
$project->setStatus(Project::FINISHED, null);
Project::$allProjects[] = $project;
$project = new Project("kodomofilm", "Kodomo no Jikan Le Film");
$project->setExternalSource(Link::newWindowLink("http://animeka.com/fansub/teams/zero.html", "Animeka"));
$project->setOriginalName("Kodomo no Jikan - Rin no Gakkyuu Nisshi");
$project->setOfficialWebsite(Link::newWindowLink("http://www.kojika-anime.com/", "Kojika-anime.com"));
$project->setAiringYear(2007);
$project->setStudio(Link::newWindowLink("http://www.stbarcelona.com/", "Studio Barcelona"));
$project->setGenre("Comédie - Ecchi");
$project->setAuthor("Watashiya Kaworu");
$project->setSynopsis("Aoki Daisuke sensei est un tout nouvel instituteur en primaire et débute sa carrière dans une classe d'enfants à priori calme, mais il découvrira que même à 9 ans on peut être bien précoce. Il fera la rencontre de Rin Kokonoe, Kuro Kagami et Mimi Usa, trois jeunes filles de sa classe qui sont prêtes à lui apporter bien des soucis, surtout pour la petite Kokonoe. Cette dernière fera tout pour que son sensei chéri tombe amoureux d'elle, par de nombreux pièges parfois osés, et rendra sa vie de nouvel instituteur très difficile. \nAu fil du temps, Aoki sensei découvrira que tout n'est pas toujours rose dans la vie de ses élèves et fera de son mieux pour les aider à surmonter les problèmes, même s'il met parfois en jeu son poste d'éducateur. Reste à voir dans quelles galères il se mettra, surtout avec le trio Kokonoe, Kagami et Usa.");
$project->setDiscussionUrl("http://forum.zerofansub.net/t252-Ton-avis-sur-Kodomo-no-Jikan.htm");
$project->setStatus(Project::FINISHED, null);
Project::$allProjects[] = $project;
$project = new Project("mitsudomoe", "Mitsudomoe");
$project->setOriginalName("Mitsudomoe");
$project->setExternalSource(Link::newWindowLink("http://animeka.com/fansub/teams/zero.html", "Animeka"));
$project->setOfficialWebsite(Link::newWindowLink("http://www.mitsudomoe-anime.com/", "Mitsudomoe Anime"));
$project->setAiringYear(2010);
$project->setStudio("Bridge");
$project->setAuthor("Sakurai Norio");
$project->setGenre("Comédie Ecchi");
$project->setSynopsis("Les triplées raconte l'histoire de trois filles de primaire un peu perverses qui harcèlent leur prof pas doué.");
$project->setDiscussionUrl("http://forum.zerofansub.net/t2051-Ton-avis-sur-Mitsudomoe.htm");
$project->setStatus(Project::FINISHED, null);
Project::$allProjects[] = $project;
$project = new Project("mitsudomoeoad", "Mitsudomoe OAD");
$project->setOriginalName("Mitsudomoe OAD");
$project->setOfficialWebsite(Link::newWindowLink("http://www.mitsudomoe-anime.com/", "Mitsudomoe Anime"));
$project->setAiringYear(2010);
//.........这里部分代码省略.........
示例6: get_by_id
public function get_by_id($project_id)
{
$proj = null;
$this->database->connect();
$sql = "SELECT * FROM projects WHERE project_id=?";
//prepare the statement
$statement = $this->database->initialize($sql);
//Bind the parameters
$statement->bind_param("i", $project_id);
//Execute the above statement
$statement->execute();
//Bind the result
$statement->bind_result($project_id, $start_date, $end_date, $title, $objectives, $short_desc, $location, $budget, $volunteer, $banner_image, $project_proposal, $video_url, $detail, $status, $u_id);
while ($statement->fetch()) {
$proj = new Project();
$proj->setProject_id($project_id);
$proj->setStart_date($start_date);
$proj->setEnd_date($end_date);
$proj->setTitle($title);
$proj->setObjectives($objectives);
$proj->setShortdes($short_desc);
$proj->setLocation($location);
$proj->setBudget($budget);
$proj->setVolunteer($volunteer);
$proj->setBanner_image($banner_image);
$proj->setProject_proposal($project_proposal);
$proj->setVideourl($video_url);
$proj->setDetail($detail);
$proj->setStatus($status);
$proj->setUid($u_id);
}
//Close Connection
$this->database->close();
return $proj;
}
示例7: array
/**
*
* @param unknown_type $rs
*/
private static function &_getObject(Resultset $rs, array $options = array())
{
isset($options['loadUsers']) ?: ($options['loadUsers'] = true);
$ret = new Project();
$ret->setAvatar($rs->getAvatar());
$ret->setScmConnectorType($rs->getScmConnectorType());
$ret->setScmRemoteRepository($rs->getScmRemoteRepository());
$ret->setScmUsername($rs->getScmUsername());
$ret->setScmPassword($rs->getScmPassword());
$ret->setScmCheckChangesTimeout($rs->getScmCheckChangesTimeout());
$ret->setWorkDir($rs->getWorkDir());
$ret->setReleaseLabel($rs->getReleaseLabel());
$ret->setDateCreation($rs->getDateCreation());
$ret->setDateCheckedForChanges($rs->getDateCheckedForChanges());
$ret->setDescription($rs->getDescription());
$ret->setId($rs->getId());
$specialTasks = @unserialize($rs->getSpecialTasks());
if ($specialTasks === false) {
$specialTasks = array();
}
$ret->setSpecialTasks($specialTasks);
$ret->setStatsNumBuilds($rs->getStatsNumBuilds());
$ret->setStatus($rs->getStatus());
$ret->setTitle($rs->getTitle());
$ret->setVisits($rs->getVisits());
$ret->setOptionReleasePackage($rs->getOptionReleasePackage());
$ret->setScmEnvVars($rs->getScmEnvVars());
//
// Builders
//
//
// The following is a workaround on the fact that the translation of this
// serialized object to the database gets all broken, due to the fact of PHP
// introducing NULL bytes around the '*' that is prepended before protected
// variable members, in the serialized mode. This method replaces those
// problematic NULL bytes with an identifier string '~~NULL_BYTE~~',
// rendering serialization and unserialization of these specific kinds of
// object safe. Credits to travis@travishegner.com on:
// http://pt.php.net/manual/en/function.serialize.php#96504
//
$unsafeSerializedIntegrationBuilder = str_replace(CINTIENT_NULL_BYTE_TOKEN, "", $rs->getIntegrationBuilder());
if (($integrationBuilder = unserialize($unsafeSerializedIntegrationBuilder)) === false) {
SystemEvent::raise(SystemEvent::ERROR, "Couldn't unserialize integration builder for this project [PID={$ret->getId()}]");
$integrationBuilder = new Build_BuilderElement_Project();
}
$ret->setIntegrationBuilder($integrationBuilder);
$unsafeSerializedDeploymentBuilder = str_replace(CINTIENT_NULL_BYTE_TOKEN, "", $rs->getDeploymentBuilder());
if (($deploymentBuilder = unserialize($unsafeSerializedDeploymentBuilder)) === false) {
SystemEvent::raise(SystemEvent::ERROR, "Couldn't unserialize deployment builder for this project [PID={$ret->getId()}]");
$deploymentBuilder = new Build_BuilderElement_Project();
}
$ret->setDeploymentBuilder($deploymentBuilder);
if ($options['loadUsers']) {
$ret->loadUsers();
}
$ret->resetSignature();
return $ret;
}
示例8: setStatus
public function setStatus($status)
{
$this->__load();
return parent::setStatus($status);
}