Ejemplo n.º 1
0
     require_once 'pages/issues_table.inc.php';
     break;
     //////// UPDATE MILESTONE
 //////// UPDATE MILESTONE
 case 'updateMilestone':
     $values = array();
     foreach ($_POST as $k => $v) {
         if (strncmp($k, 'mile_', 5) == 0) {
             if (strcmp($k, MILE_DUEDATE) == 0) {
                 $values[$k] = strtotime($v);
                 continue;
             }
             $values[$k] = $v;
         }
     }
     $error = DbHelper::exec('REPLACE INTO ' . TBL_MILESTONES . ' ' . DbHelper::convertArrToInsertValues($values));
     if ($error == null) {
         Helper::pushAlert(ALERT_SUCCESS, 'Milestone updated with success !');
     } else {
         Helper::pushAlert(ALERT_ERROR, 'An error occured while trying to insert/update the milestone !');
     }
     header('Location:index.php?p=' . PAGE_ID_ISSUES . '&n=mil');
     break;
     //////// UPDATE ISSUE DETAILS
 //////// UPDATE ISSUE DETAILS
 case 'updateIssueDetails':
     $error = DbHelper::exec('UPDATE ' . TBL_ISSUES . ' SET ' . ISSUE_MILESTONE_ID . '=' . (empty($_POST['new_milestone']) ? 'null' : $_POST['new_milestone']) . ', ' . ISSUE_COMMENT . '="' . addslashes($_POST['new_comment']) . '"' . ' WHERE ' . ISSUE_ID . '=' . $_POST['issue_id']);
     if ($error == null) {
         Helper::pushAlert(ALERT_SUCCESS, 'Issue updated with success !');
     } else {
         Helper::pushAlert(ALERT_ERROR, 'An error occured while updating the issue !');