//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++) { if ($old_evidence[$i] == $query_data['evidence_id']) { $new_evidence_id = $new_evidence[$i]; } } for ($i = 0; $i < count($old_hypotheses); $i++) {
** 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") { ?> <meta http-equiv=Refresh content="1; url=<?php echo $base_URL; ?> project/<?php