本文整理汇总了PHP中Draft::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Draft::update方法的具体用法?PHP Draft::update怎么用?PHP Draft::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draft
的用法示例。
在下文中一共展示了Draft::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public static function update($id)
{
self::check_logged_in();
$params = $_POST;
$attributes = array('id' => $id, 'name' => $row['name'], 'laatija_id' => $row['laatija_id'], 'hero1' => $row['hero1'], 'hero2' => $row['hero2'], 'hero3' => $row['hero3'], 'hero4' => $row['hero4'], 'hero5' => $row['hero5'], 'vaikeus' => $row['vaikeus'], 'suunnitelma' => $row['suunnitelma']);
$draft = new Draft($attributes);
$errors = $draft->errors();
if (count($errors) == 0) {
$draft->update();
Redirect::to('/drafts' . $draft->id, array('message' => 'Drafti on lisätty arkistoon!'));
} else {
View::make('drafts/new.html', array('errors' => $errors, 'attributes' => $attributes));
}
}
示例2: elseif
if (!empty($_POST['draft_id'])) {
Draft::remove($_POST['draft_id']);
}
// enter the time tracking entry about this new email
if (!empty($_POST['time_spent'])) {
$date = (array) $_POST['date'];
$ttc_id = Time_Tracking::getCategoryId($prj_id, 'Email Discussion');
$time_spent = (int) $_POST['time_spent'];
$summary = 'Time entry inserted when sending outgoing email.';
Time_Tracking::addTimeEntry($issue_id, $ttc_id, $time_spent, $date, $summary);
}
} elseif ($cat == 'save_draft') {
$res = Draft::saveEmail($issue_id, $_POST['to'], $_POST['cc'], $_POST['subject'], $_POST['message'], $_POST['parent_id']);
$tpl->assign('draft_result', $res);
} elseif ($cat == 'update_draft') {
$res = Draft::update($issue_id, $_POST['draft_id'], $_POST['to'], $_POST['cc'], $_POST['subject'], $_POST['message'], $_POST['parent_id']);
$tpl->assign('draft_result', $res);
}
// enter the time tracking entry about this new email
if ($cat == 'save_draft' || $cat == 'update_draft') {
if (!empty($_POST['time_spent'])) {
$date = (array) $_POST['date'];
$ttc_id = Time_Tracking::getCategoryId($prj_id, 'Email Discussion');
$time_spent = (int) $_POST['time_spent'];
$summary = 'Time entry inserted when saving an email draft.';
Time_Tracking::addTimeEntry($issue_id, $ttc_id, $time_spent, $date, $summary);
}
}
if ($cat == 'view_draft') {
$draft = Draft::getDetails($_GET['id']);
$email = array('sup_subject' => $draft['emd_subject'], 'seb_body' => $draft['emd_body'], 'sup_from' => $draft['to'], 'cc' => implode('; ', $draft['cc']));
示例3: elseif
// remove the existing email draft, if appropriate
if (!empty($HTTP_POST_VARS['draft_id'])) {
Draft::remove($HTTP_POST_VARS['draft_id']);
}
// enter the time tracking entry about this new email
if (!empty($HTTP_POST_VARS['time_spent'])) {
$HTTP_POST_VARS['issue_id'] = $issue_id;
$HTTP_POST_VARS['category'] = Time_Tracking::getCategoryID('Email Discussion');
$HTTP_POST_VARS['summary'] = 'Time entry inserted when sending outgoing email.';
Time_Tracking::insertEntry();
}
} elseif (@$HTTP_POST_VARS["cat"] == "save_draft") {
$res = Draft::saveEmail($issue_id, $HTTP_POST_VARS["to"], $HTTP_POST_VARS["cc"], $HTTP_POST_VARS["subject"], $HTTP_POST_VARS["message"], $HTTP_POST_VARS["parent_id"]);
$tpl->assign("draft_result", $res);
} elseif (@$HTTP_POST_VARS["cat"] == "update_draft") {
$res = Draft::update($issue_id, $HTTP_POST_VARS["draft_id"], $HTTP_POST_VARS["to"], $HTTP_POST_VARS["cc"], $HTTP_POST_VARS["subject"], $HTTP_POST_VARS["message"], $HTTP_POST_VARS["parent_id"]);
$tpl->assign("draft_result", $res);
} elseif (Auth::getCurrentRole() >= User::getRoleID('Developer')) {
$res = Issue::addUserAssociation($usr_id, $issue_id, $usr_id);
}
// enter the time tracking entry about this new email
if (@$HTTP_POST_VARS["cat"] == "save_draft" || @$HTTP_POST_VARS["cat"] == "update_draft") {
if (!empty($HTTP_POST_VARS['time_spent'])) {
$HTTP_POST_VARS['issue_id'] = $issue_id;
$HTTP_POST_VARS['category'] = Time_Tracking::getCategoryID('Email Discussion');
$HTTP_POST_VARS['summary'] = 'Time entry inserted when saving an email draft.';
Time_Tracking::insertEntry();
}
}
if (@$HTTP_GET_VARS['cat'] == 'view_draft') {
$draft = Draft::getDetails($HTTP_GET_VARS['id']);