public function getDiagUser($this_evidence, $active_project, $this_user) { // Get the diagnosticity. Both variables are objects. $total_diag = 0; for ($j = 0; $j < count($active_project->hypotheses); $j++) { $this_hypothesis = new Hypothesis(); $this_hypothesis->populateFromId($active_project->hypotheses[$j]); $results = mysql_fast("SELECT * FROM ratings WHERE evidence_id='{$this_evidence->id}' AND hypothesis_id='{$this_hypothesis->id}' AND user_id='{$this_user->id}'"); for ($i = 0; $i < count($results); $i++) { $total_diag += getHypoRatingScore($results[$i]['rating']); } } return $total_diag * -1; //multiple by -1 so that most diagnostic evidence appears at top upon sort }
public function showCellEdit($evidence, $sort, $display) { // $sort can be "least_likely", "most_likely", "alpha", and "added". global $active_user; $this->sortH($sort); for ($j = 0; $j < count($this->hypotheses); $j++) { $this_hypothesis = new Hypothesis(); $this_hypothesis->populateFromId($this->hypotheses[$j]); $this_rating = ""; $results = mysql_fast("SELECT * FROM ratings WHERE evidence_id='{$evidence->id}' AND hypothesis_id='{$this_hypothesis->id}' AND user_id='{$active_user->id}'"); for ($i = 0; $i < count($results); $i++) { $this_rating = $results[$i]['rating']; } $this_rating_style = strtolower(str_replace(" ", "_", str_replace("/", "", $this_rating))); echo "<td class='colgroup_" . $sort . "' id='"; ?> td_rating_<?php echo $evidence->id; ?> -<?php echo $this_hypothesis->id; ?> _<?php echo $sort; echo "' "; if (!$display) { echo 'style="display: none;" '; } echo " >"; echo "<div class='blank " . $this_rating_style . "'>"; ?> <select onChange="saveCellRating('rating_<?php echo $evidence->id; ?> -<?php echo $this_hypothesis->id; ?> _<?php echo $sort; ?> ');" class="table" id="rating_<?php echo $evidence->id; ?> -<?php echo $this_hypothesis->id; ?> _<?php echo $sort; ?> " name="rating_<?php echo $evidence->id; ?> -<?php echo $this_hypothesis->id; ?> _<?php echo $sort; ?> "> <option value="">Select:</option> <option <?php if ($this_rating == "Very Inconsistent") { echo "selected"; } ?> value="Very Inconsistent">Very Incons't</option> <option <?php if ($this_rating == "Inconsistent") { echo "selected"; } ?> value="Inconsistent">Inconsistent</option> <option <?php if ($this_rating == "N/A") { echo "selected"; } ?> value="N/A">N/A</option> <option <?php if ($this_rating == "Neutral") { echo "selected"; } ?> value="Neutral">Neutral</option> <option <?php if ($this_rating == "Consistent") { echo "selected"; } ?> value="Consistent">Consistent</option> <option <?php if ($this_rating == "Very Consistent") { echo "selected"; } ?> value="Very Consistent">Very Cons't</option> </select> <?php echo "</span>"; echo "</td>"; } }
if ($counter == 0) { ?> <h3>Comments in Your Projects</h3> <div class="recentComments"> <?php } // Probably needs optimizing. $this_project = new Project(); $this_project->get($query_data['project_id']); if ($query_data['evidence_id'] > 0) { $this_evidence = new Evidence(); $this_evidence->get($query_data['evidence_id']); } if ($query_data['hypothesis_id'] > 0) { $this_hypothesis = new Hypothesis(); $this_hypothesis->get($query_data['hypothesis_id']); } $this_user = new User(); $this_user->get($query_data['user_id']); $counter++; ?> <div class="recentComment"> <p class="comment"><a href="<?php echo $base_URL; ?> profile/<?php echo $this_user->username; ?>
** ** ACH is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** ACH 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 Open Source ACH. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// */ include "code/includes.php"; $active_hypothesis = new Hypothesis(); $active_hypothesis->populateFromId($_REQUEST['hypothesis_id']); $active_project = new Project(); $active_project->populateFromId($_REQUEST['project_id']); foreach ($_REQUEST as $field => $value) { $active_hypothesis->{$field} = addslashes($value); } $active_hypothesis->id = $_REQUEST['hypothesis_id']; $active_hypothesis->update(); setStatusMessage("Updated!"); ?> <html> <head> <title>Updating...</title> <meta http-equiv=Refresh content="0; url=project/<?php
if ($query_data['deleted'] != "y") { $this_evidence = new Evidence(); $this_evidence->populateFromId($query_data['id']); $this_evidence->project_id = $active_project->id; $this_evidence->user_id = $active_user->id; //this makes the duplicating user the creator of the new evidence, regardless of who originally created it $this_evidence->insertNew(); $new_evidence[] = $this_evidence->id; $old_evidence[] = $query_data['id']; } } //GET ALL OF THE HYPOTHESES FROM THIS MATRIX AND DUPLICATE THEM $result = mysql_do("SELECT id, deleted FROM hypotheses WHERE project_id='{$project_id}'"); while ($query_data = mysql_fetch_array($result)) { if ($query_data['deleted'] != "y") { $this_hypothesis = new Hypothesis(); $this_hypothesis->populateFromId($query_data['id']); $this_hypothesis->project_id = $active_project->id; $this_hypothesis->user_id = $active_user->id; //this makes the duplicating user the creator of the new hypothesis, regardless of who originally created it $this_hypothesis->insertNew(); $new_hypotheses[] = $this_hypothesis->id; $old_hypotheses[] = $query_data['id']; } } $active_user_id = $active_user->id; //GET ALL OF THE DUPLICATING USER'S CONSISTENCY RATINGS FOR THIS MATRIX $result = mysql_do("SELECT * FROM ratings WHERE user_id='{$active_user_id}'"); while ($query_data = mysql_fetch_array($result)) { if (in_array($query_data['evidence_id'], $old_evidence) && in_array($query_data['hypothesis_id'], $old_hypotheses)) { for ($i = 0; $i < count($old_evidence); $i++) {
images/consensusgauge.gif"></p> <table cellspacing="0" cellpadding="0" border="0" class="sort-table" id="compareMatrix"><thead><tr><th class="hypothesis"></th> <?php $active_project->getEandH(); ?> <td class="dclDateAdded" style="display: none;">Date Added</td> <td class="dclDateOfSource" style="display: none;">Date of Source</td> <td class="dclType" style="display: none;">Type</td> <td class="dclCode" style="display: none;">Code</td> <td class="dclFlag" style="display: none;">Flag</td> <?php for ($j = 0; $j < count($active_project->hypotheses); $j++) { $this_hypothesis = new Hypothesis(); $this_hypothesis->populateFromId($active_project->hypotheses[$j]); echo '<th class="hypothesis" onmouseover="return overlib(\'' . cleanForDisplay($this_hypothesis->description) . '\', CAPTION, \'Hypothesis\');" onmouseout="return nd();"><a href="' . $base_URL . 'project/' . $active_project->id . '/hypothesis/' . $this_hypothesis->id . '">' . $this_hypothesis->label . '</a> '; $rating_score = 0; for ($i = 0; $i < count($active_project->evidence); $i++) { $rating = $compare_user_2->getRating($active_project->evidence[$i], $active_project->hypotheses[$j]); $rating_score += getHypoRatingScore($rating); $rating = $compare_user->getRating($active_project->evidence[$i], $active_project->hypotheses[$j]); $rating_score += getHypoRatingScore($rating); } echo '<br><i>' . $rating_score . '</i></th>'; } echo '</tr></thead><tbody>'; for ($i = 0; $i < count($active_project->evidence); $i++) { $this_evidence = new Evidence(); $this_evidence->populateFromId($active_project->evidence[$i]);
** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** ACH 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 Open Source ACH. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// */ ?> <?php $active_hypothesis = new Hypothesis(); $active_hypothesis->populateFromId($_REQUEST['hypothesis_id']); $this_user = new User(); $this_user->populateFromId($active_hypothesis->user_id); ?> <div id="nonEdit"> <?php if ($active_project->user_id == $active_user->id) { ?> <p><a onClick="document.getElementById('edit').style.display='block'; document.getElementById('nonEdit').style.display='none';">Edit hypothesis information</a> | <?php } if ($active_project->user_id == $active_user->id) { ?> <a style="color: #FF0000;" onclick="javascript:confirm_delete_hypothesis(<?php
** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** ACH 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 Open Source ACH. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// */ include "code/includes.php"; for ($i = 1; $i <= 4; $i++) { if ($_REQUEST['label' . $i] != "") { //WITHOUT THIS, IT WILL ADD BLANK FIELDS AS NEW ROWS $active_hypothesis = new Hypothesis(); $active_hypothesis->project_id = $_REQUEST['project_id']; $active_hypothesis->label = $_REQUEST['label' . $i]; $active_hypothesis->description = $_REQUEST['description' . $i]; $active_hypothesis->user_id = $active_user->id; $active_hypothesis->insertNew(); } } setStatusMessage("Added!"); ?> <html> <head> <title>Updating...</title> <?php if ($_REQUEST['add_more'] == "on") {