File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /* For licensing terms, see /license.txt */
3
+ /*
4
+ * Update all the student publication to have the same post_group_id
5
+ * as its parents if the parent has a post_group_id
6
+ */
7
+ exit ;
8
+
9
+ require_once '../../main/inc/global.inc.php ' ;
10
+
11
+ $ workTable = Database::get_course_table (TABLE_STUDENT_PUBLICATION );
12
+
13
+ $ sql = "SELECT * FROM $ workTable WHERE parent_id = 0 AND post_group_id != 0 AND active = 1 " ;
14
+ $ res = Database::query ($ sql );
15
+ while ($ data = Database::fetch_array ($ res )) {
16
+ echo "revising c_student_publicaton ( " . $ data ['title ' ] . ") with id = " . $ data ['id ' ] . " in group = " . $ data ['post_group_id ' ];
17
+ $ updatesql = "update $ workTable set post_group_id = " . $ data ['post_group_id ' ] . " WHERE parent_id = " . $ data ['id ' ] . "; " ;
18
+ echo " update sql = " . $ updatesql ;
19
+ $ subres = Database::query ($ updatesql );
20
+ }
21
+
You can’t perform that action at this time.
0 commit comments