Menu

[r15]: / notes / editnote.php  Maximize  Restore  History

Download this file

197 lines (171 with data), 6.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
/*
** Application name: phpCollab
** Last Edit page: 04/12/2004
** Path by root: ../notes/editnote.php
** Authors: Ceam / Fullo
** =============================================================================
**
** phpCollab - Project Managment
**
** -----------------------------------------------------------------------------
** Please refer to license, copyright, and credits in README.TXT
**
** -----------------------------------------------------------------------------
** FILE: editnote.php
**
** DESC: screen: edit a note
**
** HISTORY:
** 04/12/2004 - added new document info
** 04/12/2004 - fixed [ 1077236 ] Calendar bug in Client's Project site
** 25/04/2006 - replaced JavaScript Calendar functions
** -----------------------------------------------------------------------------
** TO-DO:
** =============================================================================
*/
$checkSession = "true";
include_once('../includes/library.php');
include("../includes/customvalues.php");
if ($id != "" && $action != "add") {
$tmpquery = "WHERE note.id = '$id'";
$noteDetail = new request();
$noteDetail->openNotes($tmpquery);
$tmpquery = "WHERE pro.id = '".$noteDetail->note_project[0]."'";
$project = $noteDetail->note_project[0];
if ($noteDetail->note_owner[0] != $idSession) {
headerFunction("../notes/listnotes.php?project=$project&msg=noteOwner&".session_name()."=".session_id());
exit;
}
} else {
$tmpquery = "WHERE pro.id = '$project'";
}
$projectDetail = new request();
$projectDetail->openProjects($tmpquery);
$teamMember = "false";
$tmpquery = "WHERE tea.project = '$project' AND tea.member = '$idSession'";
$memberTest = new request();
$memberTest->openTeams($tmpquery);
$comptMemberTest = count($memberTest->tea_id);
if ($comptMemberTest == "0") {
$teamMember = "false";
} else {
$teamMember = "true";
}
//case update note entry
if ($id != "") {
//case update note entry
if ($action == "update") {
$subject = convertData($subject);
$description = convertData($description);
$tmpquery5 = "UPDATE ".$tableCollab["notes"]." SET project='$projectMenu',topic='$topic',subject='$subject',description='$description',date='$dd',owner='$idSession' WHERE id = '$id'";
$msg = "update";
connectSql("$tmpquery5");
headerFunction("../notes/viewnote.php?id=$id&msg=$msg&".session_name()."=".session_id());
exit;
}
//set value in form
$dd = $noteDetail->note_date[0];
$subject = $noteDetail->note_subject[0];
$description = $noteDetail->note_description[0];
$topic = $noteDetail->note_topic[0];
}
//case add note entry
if ($id == "") {
//case add note entry
if ($action == "add") {
$subject = convertData($subject);
$description = convertData($description);
$tmpquery1 = "INSERT INTO ".$tableCollab["notes"]."(project,topic,subject,description,date,owner,published) VALUES('$projectMenu','$topic','$subject','$description','$dd','$idSession','1')";
connectSql("$tmpquery1");
$tmpquery = $tableCollab["notes"];
last_id($tmpquery);
$num = $lastId[0];
unset($lastId);
headerFunction("../notes/viewnote.php?id=$num&msg=add&".session_name()."=".session_id());
exit;
}
}
$bodyCommand = "onLoad=\"document.etDForm.subject.focus();\"";
$includeCalendar = true; //Include Javascript files for the pop-up calendar
include('../themes/'.THEME.'/header.php');
$blockPage = new block();
$blockPage->openBreadcrumbs();
$blockPage->itemBreadcrumbs($blockPage->buildLink("../projects/listprojects.php?",$strings["projects"],in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../projects/viewproject.php?id=".$projectDetail->pro_id[0],$projectDetail->pro_name[0],in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../notes/listnotes.php?project=".$projectDetail->pro_id[0],$strings["notes"],in));
if ($id == "") {
$blockPage->itemBreadcrumbs($strings["add_note"]);
}
if ($id != "") {
$blockPage->itemBreadcrumbs($blockPage->buildLink("../notes/viewnote.php?id=".$noteDetail->note_id[0],$noteDetail->note_subject[0],in));
$blockPage->itemBreadcrumbs($strings["edit_note"]);
}
$blockPage->closeBreadcrumbs();
if ($msg != "") {
include('../includes/messages.php');
$blockPage->messagebox($msgLabel);
}
$block1 = new block();
if ($id == "") {
$block1->form = "etD";
$block1->openForm("../notes/editnote.php?project=$project&id=$id&action=add&".session_name()."=".session_id()."#".$block1->form."Anchor");
}
if ($id != "") {
$block1->form = "etD";
$block1->openForm("../notes/editnote.php?project=$project&id=$id&action=update&".session_name()."=".session_id()."#".$block1->form."Anchor");
}
if ($error != "") {
$block1->headingError($strings["errors"]);
$block1->contentError($error);
}
if ($id == "") {
$block1->heading($strings["add_note"]);
}
if ($id != "") {
$block1->heading($strings["edit_note"]." : ".$noteDetail->note_subject[0]);
}
$block1->openContent();
$block1->contentTitle($strings["details"]);
echo "<tr class='odd'><td valign='top' class='leftvalue'>".$strings["project"]." :</td><td><select name='projectMenu'>";
$tmpquery = "WHERE tea.member = '$idSession' ORDER BY pro.name";
$listProjects = new request();
$listProjects->openTeams($tmpquery);
$comptListProjects = count($listProjects->tea_id);
for ($i=0;$i<$comptListProjects;$i++) {
if ($listProjects->tea_pro_id[$i] == $noteDetail->note_project[0] || $project == $listProjects->tea_pro_id[$i]) {
echo "<option value=\"".$listProjects->tea_pro_id[$i]."\" selected>".$listProjects->tea_pro_name[$i]."</option>";
} else {
echo "<option value=\"".$listProjects->tea_pro_id[$i]."\">".$listProjects->tea_pro_name[$i]."</option>";
}
}
echo "</select></td></tr>";
$block1->contentRow($strings["date"],"<input type='text' name='dd' id='noteDate' size='20' value='$dd'><input type='button' value=' ... ' id='trigNoteDate'>");
echo "
<script type='text/javascript'>
Calendar.setup({
inputField : 'noteDate',
button : 'trigNoteDate',
$calendar_common_settings
});
</script>
";
$comptTopic = count($topicNote);
if ($comptTopic != "0") {
echo "<tr class='odd'><td valign='top' class='leftvalue'>".$strings["topic"]." :</td><td><select name='topic'><option value=''>".$strings["choice"]."</option>";
for ($i=1;$i<=$comptTopic;$i++) {
if ($topic == $i) {
echo "<option value='$i' selected>$topicNote[$i]</option>";
} else {
echo "<option value='$i'>$topicNote[$i]</option>";
}
}
echo "</select></td></tr>";
}
$block1->contentRow($strings["subject"],"<input size='44' value='$subject' style='width: 400px' name='subject' maxlength='100' type='TEXT'>");
$block1->contentRow($strings["description"],"<textarea rows='10' style='width: 400px; height: 160px;' name='description' cols='47'>$description</textarea>");
$block1->contentRow("","<input type=\"SUBMIT\" value=\"".$strings["save"]."\">");
$block1->closeContent();
$block1->closeForm();
include('../themes/'.THEME.'/footer.php');
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.