Author: frik85
Date: Sun Sep 16 22:01:38 2007
New Revision: 29070
URL:
http://svn.reactos.org/svn/reactos?rev=29070&view=rev
Log:
RosCMS update:
* fixed save function (dynamic content number save bug fixed)
* fixed stable button function (also related to dynamic content number)
* various other minor glitches fixed
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
trunk/web/reactos.org/htdocs/roscms/inc/data_export_text.php
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php Sun Sep 16 22:01:38 2007
@@ -1216,6 +1216,7 @@
global $roscms_intern_account_id;
global $roscms_standard_language;
global $RosCMS_GET_debug;
+ global $roscms_security_level;
global $h_a;
global $h_a2;
@@ -1302,26 +1303,44 @@
log_event_low("mark entry as stable: data-id
".$result_rev_data['data_id'].", rev-id
".$result_rev_data['rev_id'].log_prep_info($result_rev_data['data_id'],
$result_rev_data['rev_id'])."{changetags}");
if ($result_rev_data['rev_version'] == 0) {
+
+ $temp_dynamic = getTagValue($result_rev_data['data_id'],
$result_rev_data['rev_id'], '-1', 'number'); // get dynamic
content number
+
+ if ($RosCMS_GET_debug) echo "<p>dyn-cont-number:
".$temp_dynamic."</p>";
+
+ $roscms_sql_tags = "";
+ $roscms_sql_tags2 = "";
+ $roscms_sql_tags3 = "";
+
+ if ($temp_dynamic != "") {
+ $roscms_sql_tags .= ", data_tag a, data_tag_name n, data_tag_value v
";
+ $roscms_sql_tags2 .= ", n.tn_name, v.tv_value ";
+ $roscms_sql_tags3 .= " AND r.data_id = a.data_id
+ AND r.rev_id = a.data_rev_id
+ AND a.tag_usrid = '-1'
+ AND a.tag_name_id = n.tn_id
+ AND n.tn_name = 'number'
+ AND a.tag_value_id = v.tv_id
+ AND v.tv_value =
'".mysql_real_escape_string($temp_dynamic)."' ";
+ }
+
$query_revision_stable = mysql_query("SELECT *
- FROM data_revision
- WHERE data_id =
'".mysql_real_escape_string($result_rev_data['data_id'])."'
- AND rev_version > 0
- AND rev_language =
'".mysql_real_escape_string($result_rev_data['rev_language'])."'
- ORDER BY rev_version DESC, rev_id DESC
+ FROM data_revision r ".$roscms_sql_tags."
+ WHERE r.data_id =
'".mysql_real_escape_string($result_rev_data['data_id'])."'
+ AND r.rev_version > 0
+ AND r.rev_language =
'".mysql_real_escape_string($result_rev_data['rev_language'])."'
+ ".$roscms_sql_tags3."
+ ORDER BY r.rev_version DESC, r.rev_id DESC
LIMIT 1;");
$result_revision_stable = mysql_fetch_array($query_revision_stable);
-
+
$temp_version = 1;
- $temp_dynamic = getTagValue($result_rev_data['data_id'],
$result_rev_data['rev_id'], '-1', 'number'); // get dynamic
content number
-
- if ($RosCMS_GET_debug) echo "<p>dyn-cont-number:
".$temp_dynamic."</p>";
-
- if ($result_revision_stable['rev_id'] != "" &&
$temp_dynamic == "") { // no stable entry exist, so skip move-process
+ if ($result_revision_stable['rev_id'] != "") { // no stable
entry exist, so skip move-process
$temp_version = $result_revision_stable['rev_version'];
$temp_version++;
- if ($RosCMS_GET_debug) echo "<p>old v.:
".$result_revision_stable['rev_version']."; new v.:
".$temp_version."</p>";
+ if ($RosCMS_GET_debug) echo "<p>### old v.:
".$result_revision_stable['rev_version']."; new v.:
".$temp_version."</p>";
// delete old tag(s)
$delete_old_tags = mysql_query("DELETE FROM data_tag WHERE data_rev_id =
'".mysql_real_escape_string($result_rev_data['rev_id'])."' AND
data_id =
'".mysql_real_escape_string($result_rev_data['data_id'])."';");
@@ -1361,7 +1380,9 @@
$result_entry = mysql_fetch_array($query_entry);
log_event_generate_low("+++++
[generate_page_output_update(".$result_rev_data['data_id'].",
".$tmp_lang.", ".$temp_dynamic.")]");
+
if ($RosCMS_GET_debug) echo "<p>!
generate_page_output_update(".$result_rev_data['data_id'].",
".$tmp_lang.", ".$temp_dynamic.")</p>";
+
echo generate_page_output_update($result_entry['data_id'], $tmp_lang,
$temp_dynamic);
}
else {
@@ -1717,6 +1738,10 @@
$temp_dynamic = getTagValue($RosCMS_GET_d_id, $RosCMS_GET_d_r_id, '-1',
'number');
if ($result_edit_mef_data['data_type'] == "content" &&
$temp_dynamic != "") {
echo "_".$temp_dynamic;
+ echo "<div id=\"entryeditdynnbr\"
style=\"display:none;\">".$temp_dynamic."</div>";
+ }
+ else {
+ echo "<div id=\"entryeditdynnbr\"
style=\"display:none;\">no</div>";
}
?>
</span> <span style="white-space: nowrap;">type:
<span class="frmeditheader"><?php echo
$result_edit_mef_data['data_type']; ?></span></span>
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_export_text.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_export_text.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_export_text.php Sun Sep 16 22:01:38 2007
@@ -238,6 +238,7 @@
global $RosCMS_GET_d_value;
global $RosCMS_GET_d_value2;
global $RosCMS_GET_d_value3;
+ global $RosCMS_GET_d_value4;
$RosCMS_intern_save_rev_id = "";
$RosCMS_intern_d_rev_version = 0;
@@ -246,30 +247,53 @@
// echo "<h2>lang: ".$RosCMS_intern_d_rev_lang."</h2>";
$RosCMS_intern_d_rev_usrid = "";
- if ($RosCMS_GET_d_value3 == "draft") { /* draft */
- $query_data_save_find_draft = mysql_query("SELECT rev_id, data_id rev_version,
rev_language, rev_usrid, rev_datetime
- FROM data_revision
- WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
- AND rev_usrid =
'".mysql_real_escape_string($roscms_intern_account_id)."'
- AND rev_date =
'".mysql_real_escape_string(date("Y-m-d"))."'
- AND rev_language =
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."'
- ORDER BY rev_id DESC
+ $RosCMS_intern_d_rev_number = "";
+
+ echo "<p>!!!!!!!!!!!!!!!!!</p><hr
/><p>asdadasdawddsda</p>";
+
+ echo "<p>DynNumber: ".$RosCMS_GET_d_value4."</p>";
+
+
+
+ if ($RosCMS_GET_d_value3 == "draft") { // draft
+ $roscms_sql_tags = "";
+ $roscms_sql_tags2 = "";
+ $roscms_sql_tags3 = "";
+
+ if ($RosCMS_GET_d_value4 != "no") {
+ $roscms_sql_tags .= ", data_tag a, data_tag_name n, data_tag_value v ";
+ $roscms_sql_tags2 .= ", n.tn_name, v.tv_value ";
+ $roscms_sql_tags3 .= " AND r.data_id = a.data_id
+ AND r.rev_id = a.data_rev_id
+ AND a.tag_usrid = '-1'
+ AND a.tag_name_id = n.tn_id
+ AND n.tn_name = 'number'
+ AND a.tag_value_id = v.tv_id
+ AND v.tv_value =
'".mysql_real_escape_string($RosCMS_GET_d_value4)."' ";
+ }
+
+ $query_data_save_find_draft = mysql_query("SELECT r.rev_id, r.data_id,
r.rev_version, r.rev_language, r.rev_usrid, r.rev_datetime
".$roscms_sql_tags2."
+ FROM data_revision r ".$roscms_sql_tags."
+ WHERE r.data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
+ AND r.rev_usrid =
'".mysql_real_escape_string($roscms_intern_account_id)."'
+ AND r.rev_date =
'".mysql_real_escape_string(date("Y-m-d"))."'
+ AND r.rev_language =
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."'
+ ".$roscms_sql_tags3."
+ ORDER BY r.rev_id DESC
LIMIT 1;");
$result_data_save_find_draft = mysql_fetch_array($query_data_save_find_draft);
- //echo "<p>".getTagValue($RosCMS_GET_d_id,
$result_data_save_find_draft['rev_id'], "-1",
"status")."</p>";
-
-
- if(getTagValue($RosCMS_GET_d_id, $result_data_save_find_draft['rev_id'],
"-1", "status") == "draft") {
-// echo "<p>draft-lang:
".$result_data_save_find_draft['rev_language']."</p>";
+
+ //echo "<p>DraftEntry:
".$result_data_save_find_draft['rev_id'].",
".$result_data_save_find_draft['data_id'].",
".$result_data_save_find_draft['rev_version'].",
".$result_data_save_find_draft['tv_value']."</p>";
+
+ if (getTagValue($RosCMS_GET_d_id, $result_data_save_find_draft['rev_id'],
"-1", "status") == "draft") {
+ //echo "<p>draft-lang:
".$RosCMS_GET_d_value3."|".$RosCMS_GET_d_value4."|".$result_data_save_find_draft['rev_language']."</p>";
$RosCMS_intern_save_rev_id = $result_data_save_find_draft['rev_id'];
$RosCMS_intern_d_rev_lang = $result_data_save_find_draft['rev_language'];
$RosCMS_intern_d_rev_usrid = $result_data_save_find_draft['rev_usrid'];
$RosCMS_intern_d_rev_version = 0;
- /*$RosCMS_intern_d_rev_stext_id = $result_data_save_find_draft['rev_usrid'];
- $RosCMS_intern_d_rev_stext_id = $result_data_save_find_draft['rev_usrid'];*/
}
else { // save changes as draft based on a new/stable entry
-// echo "<p>else-lang:
".$RosCMS_GET_d_value3."|".$RosCMS_GET_d_r_lang."</p>";
+ //echo "<p>else-lang:
".$RosCMS_GET_d_value3."|".$RosCMS_GET_d_value4."|".$RosCMS_GET_d_r_lang."</p>";
//$RosCMS_GET_d_value3 = "submit"; // save instead of update
$RosCMS_intern_save_rev_id = "";
$RosCMS_intern_d_rev_version = 0;
@@ -277,26 +301,21 @@
$RosCMS_intern_d_rev_usrid = $roscms_intern_account_id;
//die("Saving draft not possible !?!");
}
- }
-
-
- if (($RosCMS_GET_d_value3 == "draft" && $RosCMS_intern_save_rev_id ==
"") || $RosCMS_GET_d_value3 == "submit") { /* add */
+
+
+ }
+
+
+ if (($RosCMS_GET_d_value3 == "draft" && $RosCMS_intern_save_rev_id ==
"") || $RosCMS_GET_d_value3 == "submit") { // add
//echo "<p>ADD</p>";
- if ($RosCMS_GET_d_value3 == "submit") {
+/* if ($RosCMS_GET_d_value3 == "submit") {
$query_data_save_find_submit = mysql_query("SELECT rev_id, data_id rev_version,
rev_language, rev_usrid, rev_datetime
FROM data_revision
WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
AND rev_language =
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."'
ORDER BY rev_id DESC
LIMIT 1;");
-/* echo "<p>SELECT rev_id, data_id rev_version, rev_language, rev_usrid,
rev_datetime
- FROM data_revision
- WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
- AND rev_language =
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."'
- ORDER BY rev_id DESC
- LIMIT 1;</p>";
-*/
$result_data_save_find_submit = mysql_fetch_array($query_data_save_find_submit);
$RosCMS_intern_d_rev_version = 0;
@@ -313,49 +332,35 @@
AND rev_version = 0
AND rev_language =
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."'
AND rev_usrid =
'".mysql_real_escape_string($RosCMS_intern_d_rev_usrid)."' ;");
-/* echo "<p>delete_draft: SELECT *
- FROM data_revision
- WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
- AND rev_version = 0
- AND rev_language =
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."'
- AND rev_usrid =
'".mysql_real_escape_string($RosCMS_intern_d_rev_usrid)."' ;";
-*/
while ($result_data_delete_old_drafts =
mysql_fetch_array($query_data_delete_old_drafts)) {
// echo "<p>delete draft:
".$result_data_delete_old_drafts['rev_id']."</p>";
deleteRevision($result_data_delete_old_drafts['rev_id']);
}
}
+*/
$insert_data_save = mysql_query("INSERT INTO data_revision ( rev_id , data_id ,
rev_version , rev_language , rev_usrid , rev_datetime , rev_date , rev_time )
VALUES (
NULL ,
'".mysql_real_escape_string($RosCMS_GET_d_id)."',
- '".mysql_real_escape_string(0)/*$RosCMS_intern_d_rev_version*/."',
+ '0',
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."',
'".mysql_real_escape_string($RosCMS_intern_d_rev_usrid)."',
NOW( ),
CURDATE( ),
CURTIME( )
- );");
+ );");//$RosCMS_intern_d_rev_version
$query_data_save_find_submit2 = mysql_query("SELECT rev_id
FROM data_revision
WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
- AND rev_version =
'".mysql_real_escape_string(0)/*$RosCMS_intern_d_rev_version*/."'
+ AND rev_version = '0'
AND rev_language =
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."'
AND rev_usrid =
'".mysql_real_escape_string($roscms_intern_account_id)."'
ORDER BY rev_datetime DESC;");
-/* echo "<p>SELECT rev_id
- FROM data_revision
- WHERE data_id =
'".mysql_real_escape_string($RosCMS_GET_d_id)."'
- AND rev_version =
'".mysql_real_escape_string($RosCMS_intern_d_rev_version)."'
- AND rev_language =
'".mysql_real_escape_string($RosCMS_intern_d_rev_lang)."'
- AND rev_usrid =
'".mysql_real_escape_string($roscms_intern_account_id)."'
- ORDER BY rev_datetime DESC;</p>";
-*/
$result_data_save_find_submit2 = mysql_fetch_array($query_data_save_find_submit2);
//$result_data_save_find_submit2['rev_id'];
- for ($i=1; $i <= $RosCMS_POST_d_stextsum; $i++) { /* short text */
+ for ($i=1; $i <= $RosCMS_POST_d_stextsum; $i++) { //short text
$insert_data_save_stext = mysql_query("INSERT INTO data_stext ( stext_id ,
data_rev_id , stext_name , stext_content )
VALUES (
NULL ,
@@ -364,7 +369,7 @@
'".mysql_real_escape_string($_POST["pstext".$i])."'
);");
}
- for ($i=1; $i <= $RosCMS_POST_d_textsum; $i++) { /* text */
+ for ($i=1; $i <= $RosCMS_POST_d_textsum; $i++) { // text
$insert_data_save_text = mysql_query("INSERT INTO data_text ( text_id ,
data_rev_id , text_name , text_content )
VALUES (
NULL ,
@@ -383,6 +388,11 @@
// echo "<h4>submit_process: tag_add(".$RosCMS_GET_d_id.",
".$result_data_save_find_submit2['rev_id'].", 'status',
'draft', '-1');</h4>";
tag_add($RosCMS_GET_d_id, $result_data_save_find_submit2['rev_id'],
'status', 'draft', '-1');
}
+
+ if ($RosCMS_GET_d_value4 != "no") {
+ tag_add($RosCMS_GET_d_id, $result_data_save_find_submit2['rev_id'],
'number', $RosCMS_GET_d_value4, '-1');
+ }
+ //tag_add($RosCMS_GET_d_id, $result_data_save_find_submit2['rev_id'],
'debug', '1', '-1');
}
else if ($RosCMS_intern_save_rev_id != "" && $RosCMS_GET_d_value3 ==
"draft") {
//echo "<p>UPDATE</p>";
@@ -390,7 +400,7 @@
$insert_data_save_stext = mysql_query("DELETE FROM data_stext WHERE data_rev_id =
'".mysql_real_escape_string($RosCMS_intern_save_rev_id)."';");
$insert_data_save_stext = mysql_query("DELETE FROM data_text WHERE data_rev_id =
'".mysql_real_escape_string($RosCMS_intern_save_rev_id)."';");
- for ($i=1; $i <= $RosCMS_POST_d_stextsum; $i++) { /* short text */
+ for ($i=1; $i <= $RosCMS_POST_d_stextsum; $i++) { // short text
if (array_key_exists("pdstext".$i, $_POST)) {
$insert_data_save_stext = mysql_query("INSERT INTO data_stext ( stext_id ,
data_rev_id , stext_name , stext_content )
VALUES (
@@ -401,7 +411,7 @@
);");
}
}
- for ($i=1; $i <= $RosCMS_POST_d_textsum; $i++) { /* text */
+ for ($i=1; $i <= $RosCMS_POST_d_textsum; $i++) { // text
if (array_key_exists("pdtext".$i, $_POST)) {
$insert_data_save_text = mysql_query("INSERT INTO data_text ( text_id ,
data_rev_id , text_name , text_content )
VALUES (
@@ -413,6 +423,7 @@
}
//echo "<p><pre>".$_POST["pdtext".$i].": <br
/>\n".$_POST["plm".$i]."</pre></p>";
}
+ //tag_add($RosCMS_GET_d_id, $RosCMS_intern_save_rev_id, 'debug', '2',
'-1');
}
else {
@@ -420,6 +431,8 @@
}
+
+
}
?>
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_export_xml.php Sun Sep 16 22:01:38 2007
@@ -846,4 +846,4 @@
}
-?>
+?>
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/data_list.php Sun Sep 16 22:01:38 2007
@@ -2199,7 +2199,7 @@
cmdbarstr += cmdhtml_select_mn;
cmdbarstr += cmdhtml_select_ms;
cmdbarstr += cmdhtml_select_va;
- cmdbarstr += cmdhtml_select_xe;
+ cmdbarstr += cmdhtml_select_xe2;
cmdbarstr += cmdhtml_select2;
break;
case 'page':
@@ -2626,7 +2626,7 @@
// alert('save_draft::::::::\n\n '+poststr.substr(1));
- usf_req =
'?page=data_out&d_f=text&d_u=asi&d_fl=new&d_id='+encodeURIComponent(did)+'&d_r_id='+encodeURIComponent(drid)+'&d_r_lang='+encodeURIComponent(document.getElementById("mefrlang").innerHTML)+'&d_r_ver='+encodeURIComponent(document.getElementById("mefrverid").innerHTML)+'&d_val='+encodeURIComponent(document.getElementById("estextcount").className)+'&d_val2='+encodeURIComponent(document.getElementById("elmcount").className)+'&d_val3=draft';
+ usf_req =
'?page=data_out&d_f=text&d_u=asi&d_fl=new&d_id='+encodeURIComponent(did)+'&d_r_id='+encodeURIComponent(drid)+'&d_r_lang='+encodeURIComponent(document.getElementById("mefrlang").innerHTML)+'&d_r_ver='+encodeURIComponent(document.getElementById("mefrverid").innerHTML)+'&d_val='+encodeURIComponent(document.getElementById("estextcount").className)+'&d_val2='+encodeURIComponent(document.getElementById("elmcount").className)+'&d_val3=draft&d_val4='+encodeURIComponent(document.getElementById("entryeditdynnbr").innerHTML);
<?php if ($RosCMS_GET_debug) { ?>
debugLog(usf_req);
<?php } ?>