} } break; case 'massupdate': if (!form_key_is_valid(getStringFromRequest('form_key'))) { exit_form_double_submit(); } $artifact_id_list = getArrayFromRequest('artifact_id_list'); $priority = getStringFromRequest('priority'); $status_id = getStringFromRequest('status_id'); $category_id = getStringFromRequest('category_id'); $artifact_group_id = getStringFromRequest('artifact_group_id'); $resolution_id = getStringFromRequest('resolution_id'); $assigned_to = getStringFromRequest('assigned_to'); $canned_response = getIntFromRequest("canned_response"); $extra_fields = getArrayFromRequest('extra_fields'); $count = count($artifact_id_list); if (!$ath->userIsAdmin()) { exit_permission_denied(); } $artifact_type_id = $ath->getID(); for ($i = 0; $i < $count; $i++) { $ah = new Artifact($ath, $artifact_id_list[$i]); if (!$ah || !is_object($ah)) { $feedback .= ' ID: ' . $artifact_id_list[$i] . '::Artifact Could Not Be Created'; } else { if ($ah->isError()) { $feedback .= ' ID: ' . $artifact_id_list[$i] . '::' . $ah->getErrorMessage(); } else { $_priority = $priority != 100 ? $priority : $ah->getPriority(); $_status_id = $status_id != 100 ? $status_id : $ah->getStatusID();
$params['toptab'] = 'wiki'; $params['group'] = $id; /* Show horizontal links */ site_project_header($params); } $user = session_get_user(); // get the session user if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) { exit_error("Invalid User", "Cannot Process your request for this user."); } $type = getStringFromRequest('type'); $id = getIntFromRequest('id'); $pluginname = 'wiki'; $config = getArrayFromRequest('config'); if (!$type) { exit_error("Cannot Process your request", "No TYPE specified"); } elseif (!$id) { exit_error("Cannot Process your request", "No ID specified"); } else { if ($type == 'admin_post') { $group = group_get_object($id); if (!$group) { exit_error(_('Invalid Project'), _('Inexistent Project')); } if (!$group->usesPlugin($pluginname)) { //check if the group has the wiki plugin active exit_error("Error", "First activate the {$pluginname} plugin through the Project's Admin Interface"); } $userperm = $group->getPermission($user);
} else { $feedback .= _('NewsByte Deleted.'); } } } /* Show the list_queue */ $approve = ''; $list_queue = 'y'; } else { if (getStringFromRequest('mass_reject')) { /* Move msg to rejected status */ $news_id = getArrayFromRequest('news_id'); $sql = "UPDATE news_bytes " . "SET is_approved='2' " . "WHERE id IN ('" . implode("','", $news_id) . "')"; $result = db_query($sql); if (!$result || db_affected_rows($result) < 1) { $feedback .= _('Error On Update:'); $feedback .= db_error(); } else { $feedback .= _('NewsBytes Rejected.'); } } } } news_header(array('title' => _('News admin'))); if ($approve) { /* Show the submit form
$sw = 'A'; } $sql = "SELECT user_id,user_name,lastname,firstname FROM users "; if ($sys_database_type == "mysql") { $sql .= "WHERE status='A' and type_id='1' and lastname LIKE '{$sw}%' "; } else { $sql .= "WHERE status='A' and type_id='1' and lastname ILIKE '{$sw}%' "; } $res = db_query($sql); $accumulated_ids = getStringFromRequest('accumulated_ids'); if (!$accumulated_ids) { $accumulated_ids = array(); } else { $accumulated_ids =& explode(',', $accumulated_ids); } $newids = getArrayFromRequest('newids'); if (count($newids) > 0) { if (count($accumulated_ids) > 0) { $accumulated_ids = array_merge($accumulated_ids, $newids); } else { $accumulated_ids = $newids; } } $accumulated_ids = array_unique($accumulated_ids); if (getStringFromRequest('finished')) { header("Location: massfinish.php?group_id={$group_id}&accumulated_ids=" . implode(',', $accumulated_ids)); } project_admin_header(array('title' => _('Edit Role'), 'group' => $group_id)); echo ' <h2>' . _('Add Users From List') . '</h2> <p>
$vars[$keys[$i]] == "true" ? $checkedtrue = ' checked="checked" ' : ($checkedfalse = ' checked="checked" '); echo '<tr ' . $HTML->boxGetAltRowStyle($j + 1) . '>' . '<td>' . $keys[$i] . '</td>' . '<td style="text-align:center"><input type="radio" name="attributes[' . $keys[$i] . ']" value="true" ' . $checkedtrue . '/>' . '</td>' . '<td style="text-align:center"><input type="radio" name="attributes[' . $keys[$i] . ']" value="false" ' . $checkedfalse . '/></td>' . '</tr>' . "\n"; $j++; } echo $HTML->listTableBottom(); /*echo '<br><center>' . html_build_rich_textarea('filedata',30,150,$filedata,false) . '</center>';*/ echo '<br />'; if ($has_write) { echo '<div align="center"><input type="submit" name="doedit" value="' . _('Save') . '"/></div>'; } } else { // say we couldn't open the file $feedback .= _('Could not open the file for read. Check the permissions for apache') . '<br />'; } } elseif (getStringFromRequest('doedit')) { updateVars(getArrayFromRequest('attributes'), $gfcgfile); // perhaps later we'll update something else, for now it's local.inc /*$filedata = getStringFromRequest('filedata'); $filedata = str_replace('\"','"',$filedata); $filedata = str_replace("\'","'",$filedata); $filepath = getStringFromRequest('filepath'); if ($handle = fopen($filepath,'w')) { if (fwrite($handle,$filedata)) { // say wrote ok $feedback .= _('File wrote successfully.<br>'); } else { // say some problem $feedback .= _('File wasn\'t written or is empty.<br>'); } } else { // say couldn't open
* FusionForge is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ global $group_id, $HTML; $atf = $taskboard->TrackersAdapter->getArtifactTypeFactory(); if (!$atf || !is_object($atf) || $atf->isError()) { echo json_encode(array('message' => _('Could Not Get ArtifactTypeFactory'))); exit; } $used_trackers = getArrayFromRequest('trackers'); $ret = array('messages' => ''); $common_fields = array(); $allowed_types = array(1, 4, 9); foreach ($allowed_types as $allowed_type) { $common_fields[$allowed_type] = array(); } $at_arr = $atf->getArtifactTypes(); $init = true; for ($j = 0; $j < count($at_arr); $j++) { if (!is_object($at_arr[$j])) { //just skip it } elseif ($at_arr[$j]->isError()) { echo json_encode(array('message' => $at_arr[$j]->getErrorMessage())); exit; } else {
* * Copyright 2006 (c) GForge, LLC * http://gforge.org * * @version $Id$ */ require_once '../env.inc.php'; require_once $gfwww . 'include/pre.php'; /* Project Summary Page Written by dtype Oct. 1999 */ $group_id = getIntFromRequest("group_id"); $begin = getStringFromRequest("start_date"); $end = getStringFromRequest("end_date"); $show = getArrayFromRequest("show"); if (!$begin || $begin == 0) { $begin = time() - 30 * 86400; } else { $begin = strtotime($begin); } if (!$end || $end == 0) { $end = time(); } else { $end = strtotime($end) + 86400; } if ($begin > $end) { $endtmp = $end; $end = $begin; $begin = $endtmp; }
foreach ($taskboard->getUsedTrackersData() as $used_tracker_data) { $trackers_selected[] = $used_tracker_data['group_artifact_id']; $trackers_bgcolor[$used_tracker_data['group_artifact_id']] = $used_tracker_data['card_background_color']; $release_field = $taskboard->getReleaseField(); $release_field_tracker = $taskboard->getReleaseFieldTracker(); $estimated_cost_field = $taskboard->getEstimatedCostField(); $remaining_cost_field = $taskboard->getRemainingCostField(); $user_stories_tracker = $taskboard->getUserStoriesTrackerID(); $user_stories_reference_field = $taskboard->getUserStoriesReferenceField(); $user_stories_sort_field = $taskboard->getUserStoriesSortField(); $first_column_by_default = $taskboard->getFirstColumnByDefault(); } } if (getStringFromRequest('post_changes')) { $trackers_selected = getArrayFromRequest('use', array()); $trackers_bgcolor = getArrayFromRequest('bg', array()); $release_field = getStringFromRequest('release_field', ''); $release_field_tracker = getIntFromRequest('release_field_tracker', 1); $estimated_cost_field = getStringFromRequest('estimated_cost_field', ''); $remaining_cost_field = getStringFromRequest('remaining_cost_field', ''); $user_stories_tracker = getStringFromRequest('user_stories_tracker', ''); $user_stories_reference_field = getStringFromRequest('user_stories_reference_field', ''); $user_stories_sort_field = getStringFromRequest('user_stories_sort_field', ''); $first_column_by_default = getIntFromRequest('first_column_by_default', '0'); // try to save data if ($taskboard->getID()) { $ret = $taskboard->update($trackers_selected, $trackers_bgcolor, $release_field, $release_field_tracker, $estimated_cost_field, $remaining_cost_field, $user_stories_tracker, $user_stories_reference_field, $user_stories_sort_field, $first_column_by_default); } else { $ret = $taskboard->create($trackers_selected, $trackers_bgcolor, $release_field, $release_field_tracker, $estimated_cost_field, $remaining_cost_field, $user_stories_tracker, $user_stories_reference_field, $user_stories_sort_field, $first_column_by_default); } if (!$ret) {
handle_multi_edit($skill_edit); echo '<input type="hidden" name="confirmMultiEdit" value="1" />'; echo '<input type="submit" name="MultiEdit" value="' . _('Done') . '" />'; echo '<input type="submit" name="cancelMultiEdit" value="' . _('Cancel') . '" />'; echo '</form>'; people_footer(array()); return; } } } else { if (getStringFromRequest('cancelMultiEdit')) { $feedback = _('Cancelled skills update'); } } if (getStringFromRequest('MultiDelete')) { $unfiltered_skill_delete_array = getArrayFromRequest('skill_delete'); $skill_delete = array(); foreach ($unfiltered_skill_delete as $usd) { if (is_numeric($usd)) { $skill_delete[] = $usd; } } $numItems = count($skill_delete); if ($numItems == 0) { $feedback .= _('No skills selected to delete.'); } else { if (getStringFromRequest('confirmMultiDelete')) { if (!form_key_is_valid(getStringFromRequest('form_key'))) { exit_form_double_submit(); } $sql = "DELETE FROM skills_data where skills_data_id in(" . $skill_delete[0];
* by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * * FusionForge is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ $column_id = getStringFromRequest('column_id', ''); $column =& taskboard_column_get_object($column_id); if (getStringFromRequest('post_changes')) { $resolutions = getArrayFromRequest('resolutions', array()); $column_title = getStringFromRequest('column_title', ''); $title_bg_color = getStringFromRequest('title_bg_color', ''); $color_bg_color = getStringFromRequest('column_bg_color', ''); $column_max_tasks = getStringFromRequest('column_max_tasks', ''); $column->update($column_title, $title_bg_color, $color_bg_color, $column_max_tasks); $column->setResolutions($resolutions); $resolution_by_default = getStringFromRequest('resolution_by_default', ''); $alert = getStringFromRequest('alert', ''); $autoassign = getIntFromRequest('autoassign', 0); db_begin(); if ($column->setDropRule(NULL, $resolution_by_default, $alert, $autoassign)) { db_commit(); $feedback .= _('Succefully Updated'); } else { db_rollback();
/** * ExecuteAction - Executes the action passed as parameter * * @param string action to execute. */ function ExecuteAction($action) { global $HTML; if ($action == "change_status") { //change a forum $forum_name = getStringFromRequest('forum_name'); $description = getStringFromRequest('description'); $send_all_posts_to = getStringFromRequest('send_all_posts_to'); $allow_anonymous = getIntFromRequest('allow_anonymous'); $is_public = getIntFromRequest('is_public'); $moderation_level = getIntFromRequest('moderation_level'); $group_forum_id = getIntFromRequest('group_forum_id'); /* Change a forum */ $f = new Forum($this->g, $group_forum_id); if (!$f || !is_object($f)) { exit_error(_('Error'), _('Error getting Forum')); } elseif ($f->isError()) { exit_error(_('Error'), $f->getErrorMessage()); } if (!$f->userIsAdmin()) { exit_permission_denied(); } if (!$f->update($forum_name, $description, $allow_anonymous, $is_public, $send_all_posts_to, $moderation_level)) { exit_error(_('Error'), $f->getErrorMessage()); } else { $feedback = _('Forum Info Updated Successfully'); } return $feedback; } if ($action == "add_forum") { //add forum $forum_name = getStringFromRequest('forum_name'); $description = getStringFromRequest('description'); $is_public = getStringFromRequest('is_public'); $send_all_posts_to = getStringFromRequest('send_all_posts_to'); $allow_anonymous = getStringFromRequest('allow_anonymous'); $moderation_level = getIntFromRequest('moderation_level'); /* Adding forums to this group */ if (!$this->p->isForumAdmin()) { form_release_key(getStringFromRequest("form_key")); exit_permission_denied(); } $f = new Forum($this->g); if (!$f || !is_object($f)) { form_release_key(getStringFromRequest("form_key")); exit_error(_('Error'), _('Error getting Forum')); } elseif ($f->isError()) { form_release_key(getStringFromRequest("form_key")); exit_error(_('Error'), $f->getErrorMessage()); } if (!$f->create($forum_name, $description, $is_public, $send_all_posts_to, 1, $allow_anonymous, $moderation_level)) { form_release_key(getStringFromRequest("form_key")); exit_error(_('Error'), $f->getErrorMessage()); } else { $feedback = _('Forum created successfully'); } return $feedback; } if ($action == "delete") { //Deleting messages or threads $msg_id = getStringFromRequest('deletemsg'); $forum_id = getIntFromRequest('forum_id'); $f = new Forum($this->g, $forum_id); if (!$f || !is_object($f)) { exit_error(_('Error'), _('Error getting Forum')); } elseif ($f->isError()) { exit_error(_('Error'), $f->getErrorMessage()); } if (!$f->userIsAdmin()) { exit_permission_denied(); } $fm = new ForumMessage($f, $msg_id); if (!$fm || !is_object($fm)) { exit_error(_('Error'), _('Error Getting ForumMessage')); } elseif ($fm->isError()) { exit_error(_('Error'), $fm->getErrorMessage()); } $count = $fm->delete(); if (!$count || $fm->isError()) { exit_error(_('Error'), $fm->getErrorMessage()); } else { $feedback = sprintf(ngettext('%1$s message deleted', '%1$s messages deleted', $count), $count); } return $feedback; } if ($action == "delete_forum") { //delete the forum /* Deleting entire forum */ $group_forum_id = getIntFromRequest('group_forum_id'); $f = new Forum($this->g, $group_forum_id); if (!$f || !is_object($f)) { exit_error(_('Error'), _('Error getting Forum')); } elseif ($f->isError()) { exit_error(_('Error'), $f->getErrorMessage()); } if (!$f->userIsAdmin()) { exit_permission_denied(); } if (!$f->delete(getStringFromRequest('sure'), getStringFromRequest('really_sure'))) { exit_error(_('Error'), $f->getErrorMessage()); } else { $feedback = _('Successfully Deleted'); } return $feedback; } if ($action == "view_pending") { //show the pending messages, awaiting moderation $group_id = $this->group_id; $forum_id = getStringFromRequest("forum_id"); if ($this->isGroupAdmin()) { $this->PrintAdminOptions(); } $sql = "SELECT forum_name, group_forum_id FROM forum_group_list WHERE group_id='{$group_id}' and moderation_level > 0"; $res = db_query($sql); if (!$res) { echo db_error(); return; } global $sys_db_row_pointer; $moderated_forums = array(); for ($i = 0; $i < db_numrows($res); $i++) { $aux = db_fetch_array($res); $moderated_forums[$aux[1]] = $aux[0]; } if (count($moderated_forums) == 0) { echo $HTML->feedback(_('No forums are moderated for this group')); forum_footer(array()); exit; } if (!$forum_id) { //get the first one $keys = array_keys($moderated_forums); $forum_id = $keys[0]; } echo ' <script language="JavaScript" type="text/javascript"> function confirmDel() { var agree=confirm("Proceed? Actions are permanent!"); if (agree) { return true; } else { return false; } } </script> <p><form name="pending" action="pending.php" method="post"> <input type="hidden" name="action" value="update_pending" /> <input type="hidden" name="form_key" value="' . form_generate_key() . '"> <input type="hidden" name="group_id" value="' . getIntFromRequest("group_id") . '" /> <input type="hidden" name="forum_id" value="' . $forum_id . '" /> '; //$moderated_forums["A"] = "All Forums for this group"; // to show all echo html_build_select_box_from_assoc($moderated_forums, forum_id, $forum_id); echo ' <input name="Go" type="submit" value="Go"><p>'; $title = array(); $title[] = _('Forum Name'); $title[] = _('Message'); $title[] = "Action"; $sql = "SELECT msg_id,subject,pm.group_forum_id,gl.forum_name FROM forum_pending_messages pm, forum_group_list gl WHERE pm.group_forum_id='{$forum_id}' AND pm.group_forum_id=gl.group_forum_id AND gl.group_forum_id='{$forum_id}'"; $res = db_query($sql); if (!$res) { echo db_error(); return; } $options = array("1" => "No action", "2" => "Delete", "3" => "Release"); //array with the supported actions //i�ll make a hidden variable, helps to determine when the user updates the info, which action corresponds to which msgID for ($i = 0; $i < db_numrows($res); $i++) { $ids .= db_result($res, $i, 'msg_id') . ","; } $i = 2; echo $HTML->listTableTop($title); while ($onemsg = db_fetch_array($res)) { //$url = 'pendingmsgdetail.php?msg_id=' . $onemsg[msg_id]; //<a href=\"javascript:msgdetail('$url');\">$onemsg[subject]</a> $url = "http://www.google.com"; echo "\n\t\t\t\t<tr" . $HTML->boxGetAltRowStyle($i++) . ">\n\t\t\t\t\t<td>{$onemsg['forum_name']}</td>\t\n\t\t\t\t\t<td><a href=\"#\" OnClick=\"window.open('pendingmsgdetail.php?msg_id={$onemsg['msg_id']}&forum_id={$onemsg['group_forum_id']}&group_id={$group_id}','PendingMessageDetail','width=800,height=600,status=no,resizable=yes');\">{$onemsg['subject']}</a></td>\n\t\t\t\t\t<td><div align=\"right\">" . html_build_select_box_from_assoc($options, "doaction[]", 1) . "</div></td>\n\t\t\t\t</tr>"; } echo $HTML->listTableBottom(); echo ' <p> <input type="hidden" name="msgids" value="' . $ids . '"> <div align="right"><input type="submit" onClick="return confirmDel();" name="update" value="' . _('Update') . '"></div> </form> '; } if ($action == "update_pending") { $group_id = getIntFromRequest("group_id"); $forum_id = getIntFromRequest("forum_id"); $msgids = getStringFromRequest("msgids"); //the message ids to update $doaction = getArrayFromRequest("doaction"); //the actions for the messages $msgids = split(",", $msgids); array_pop($msgids); //this last one is empty /*if ($this->isGroupAdmin()) { $this->PrintAdminOptions(); }*/ $results = array(); //messages for ($i = 0; $i < count($msgids); $i++) { switch ($doaction[$i]) { case 1: //no action break; case 2: //delete db_begin(); $sql = "DELETE FROM forum_pending_attachment WHERE msg_id='{$msgids[$i]}'"; if (!db_query($sql)) { $feedback .= "DB Error "; $feedback .= db_error() . "<br>"; db_rollback(); break; } $sql = "DELETE FROM forum_pending_messages WHERE msg_id='{$msgids[$i]}'"; if (!db_query($sql)) { $feedback .= "DB Error "; $feedback .= db_error() . "<br>"; db_rollback(); break; } db_commit(); $feedback .= _('Forum deleted'); break; case 3: //release $sql = "SELECT * FROM forum_pending_messages WHERE msg_id='{$msgids[$i]}'"; $res1 = db_query($sql); if (!$res1) { $feedback .= "DB Error " . db_error() . "<br>"; break; } $sql = "SELECT * FROM forum_pending_attachment WHERE msg_id='{$msgids[$i]}'"; $res2 = db_query($sql); if (!$res2) { $feedback .= "DB Error " . db_error() . "<br>"; break; } $f = new Forum($this->g, $forum_id); if (!$f || !is_object($f)) { exit_error(_('Error'), _('Error getting new Forum')); } elseif ($f->isError()) { exit_error(_('Error'), $f->getErrorMessage()); } $fm = new ForumMessage($f); // pending = false if (!$fm || !is_object($fm)) { exit_error(_('Error'), "Error getting new ForumMessage"); } elseif ($fm->isError()) { exit_error(_('Error'), "Error getting new ForumMessage: " . $fm->getErrorMessage()); } $group_forum_id = db_result($res1, 0, "group_forum_id"); $subject = db_result($res1, 0, "subject"); $body = db_result($res1, 0, "body"); $post_date = db_result($res1, 0, "post_date"); $thread_id = db_result($res1, 0, "thread_id"); $is_followup_to = db_result($res1, 0, "is_followup_to"); $posted_by = db_result($res1, 0, "posted_by"); $has_followups = db_result($res1, 0, "has_followups"); $most_recent_date = db_result($res1, 0, "most_recent_date"); if ($fm->insertreleasedmsg($group_forum_id, $subject, $body, $post_date, $thread_id, $is_followup_to, $posted_by, $has_followups, time())) { $feedback .= "( {$subject} ) " . _('Pending forum released') . "<br>"; if (db_numrows($res2) > 0) { //if there�s an attachment $am = new AttachManager(); //object that will handle and insert the attachment into the db $am->SetForumMsg($fm); $userid = db_result($res2, 0, "userid"); $dateline = db_result($res2, 0, "dateline"); $filename = db_result($res2, 0, "filename"); $filedata = db_result($res2, 0, "filedata"); $filesize = db_result($res2, 0, "filesize"); $visible = db_result($res2, 0, "visible"); $msg_id = db_result($res2, 0, "msg_id"); $filehash = db_result($res2, 0, "filehash"); $mimetype = db_result($res2, 0, "mimetype"); $am->AddToDBOnly($userid, $dateline, $filename, $filedata, $filesize, $visible, $filehash, $mimetype); foreach ($am->Getmessages() as $item) { $feedback .= "{$msg_id} - " . $item . "<br>"; } } $deleteok = true; } else { if ($fm->isError()) { if ($fm->getErrorMessage() == _('Couldn\'t Update Master Thread parent with current time')) { //the thread which the message was replying to doesn�t exist any more $feedback .= "( " . $subject . " ) " . _('The thread which the message was posted to doesn\'t exist anymore, please delete the message.') . "<br>"; } else { $feedback .= "{$msg_id} - " . $fm->getErrorMessage() . "<br>"; } $deleteok = false; } } if (isset($am) && is_object($am)) { //if there was an attach, check if it was uploaded ok if (!$am->isError()) { $deleteok = true; } else { //undo the changes to the forum table db_begin(); $sql = "DELETE FROM forum WHERE msg_id='{$fm->getID}()'"; if (!db_query($sql)) { $feedback .= "DB Error "; $feedback .= db_error() . "<br>"; db_rollback(); break; } db_commit(); $deleteok = false; } } if ($deleteok) { //delete the message and attach db_begin(); $sql = "DELETE FROM forum_pending_attachment WHERE msg_id='{$msgids[$i]}'"; if (!db_query($sql)) { $feedback .= "DB Error "; $feedback .= db_error() . "<br>"; db_rollback(); break; } $sql = "DELETE FROM forum_pending_messages WHERE msg_id='{$msgids[$i]}'"; if (!db_query($sql)) { $feedback .= "DB Error "; $feedback .= db_error() . "<br>"; db_rollback(); break; } db_commit(); } } } html_feedback_top($feedback); $page = 0; $this->ExecuteAction("view_pending"); } }