Explorar o código

群组去掉project支持

visuddhinanda %!s(int64=5) %!d(string=hai) anos
pai
achega
5883b7ea15

+ 9 - 3
app/article/my_article.js

@@ -1,6 +1,8 @@
 var _display = "para";
+var share_win;
 function my_article_init() {
 	my_article_list();
+	share_win = iframe_win_init({ container: "share_win", name: "share", width: "500px" });
 	article_add_dlg_init("article_add_div");
 }
 function my_article_list() {
@@ -25,7 +27,7 @@ function my_article_list() {
 					html += "<div style='flex:1;'>" + gLocal.gui.copy_link + "</div>";
 					html += "<div style='flex:1;'>" + gLocal.gui.edit + "</a></div>";
 					html += "<div style='flex:1;'>" + gLocal.gui.preview + "</a></div>";
-					html += "<div style='flex:1;'>15</div>";
+					html += "<div style='flex:1;'></div>";
 					html += "</div>";
 					//列表
 					for (const iterator of result) {
@@ -47,7 +49,9 @@ function my_article_list() {
 							"' target='_blank'>" +
 							gLocal.gui.preview +
 							"</a></div>";
-						html += "<div style='flex:1;'>15</div>";
+						html += "<div style='flex:1;'>";
+						html += "<a onclick=\"article_share('" + iterator.id + "')\">share</a>";
+						html += "</div>";
 						html += "</div>";
 					}
 					$("#article_list").html(html);
@@ -60,7 +64,9 @@ function my_article_list() {
 		}
 	);
 }
-
+function article_share(id) {
+	share_win.show("../share/share.php?id=" + id + "&type=3");
+}
 function render_status(status) {
 	status = parseInt(status);
 	let html = "";

+ 3 - 1
app/article/my_article_index.php

@@ -66,7 +66,9 @@ require_once '../studio/index_head.php';
 			</div>
 		</div>
 	</div>
-	
+	<div class="modal_win_bg">
+	<div id="share_win" class="iframe_container"></div>
+</div>
 <?php
 require_once '../studio/index_foot.php';
 ?>

+ 3 - 2
app/channal/channal.js

@@ -220,7 +220,8 @@ function my_channal_edit(id) {
 					html += "</div>";
 					html += "</div>";
 					html += "</div>";
-
+					/*
+					旧的channel分享方式 删除
 					html += "<div id='coop_div' style='padding:5px;position: relative;'>";
 					html += "<h2>" + gLocal.gui.cooperators + "</h2>";
 
@@ -257,7 +258,7 @@ function my_channal_edit(id) {
 					}
 					html += "</div>";
 					html += "</div>";
-
+*/
 					$("#channal_info").html(html);
 					user_select_dlg_init("add_coop_user_dlg");
 					tran_lang_select_init("channal_lang_select");

+ 27 - 10
app/group/group.js

@@ -111,10 +111,13 @@ function group_list(id, list) {
 					let html = "";
 					let result = JSON.parse(data);
 					let key = 1;
-					html += "<div class='info_block'>";
-					html += "<h2>" + gLocal.gui.introduction + "</h2>";
-					html += result.info.description;
-					html += "</div>";
+					if (typeof result.info.description != "undefined" && result.info.description.length > 0) {
+						html += "<div class='info_block'>";
+						html += "<h2>" + gLocal.gui.introduction + "</h2>";
+						html += marked(result.info.description);
+						html += "</div>";
+					}
+
 					$("#curr_group").html("/" + result.info.name);
 
 					if (result.parent) {
@@ -127,6 +130,8 @@ function group_list(id, list) {
 								"</a> "
 						);
 					} else {
+						/*
+						关闭子小组功能
 						if (result.info.creator == getCookie("userid")) {
 							$("#button_new_sub_group").show();
 						}
@@ -165,6 +170,7 @@ function group_list(id, list) {
 							html += "尚未设置小组";
 						}
 						html += "</div>";
+*/
 					}
 
 					//共享文件列表
@@ -179,18 +185,29 @@ function group_list(id, list) {
 							//资源类型
 							html += "<svg class='icon'>";
 							let cardUrl = "";
+							let doing = "";
 							switch (parseInt(iterator.res_type)) {
 								case 1: //pcs
-									html += "<use xlink:href='../studio/svg/icon.svg#ic_person'></use>";
+									html += "<use xlink:href='../studio/svg/icon.svg#article'></use>";
 									cardUrl = "../doc/card.php";
+									html +=
+										"<a href='../studio/project.php?op=open&doc_id=" +
+										iterator.res_id +
+										"'>打开</a>";
 									break;
 								case 2: //channel
 									html += "<use xlink:href='../studio/svg/icon.svg#channel_leaves'></use>";
 									cardUrl = "../channal/card.php";
 									break;
 								case 3: //article
-									html += "<use xlink:href='../studio/svg/icon.svg#channel_leaves'></use>";
+									html += "<use xlink:href='../studio/svg/icon.svg#article-1'></use>";
 									cardUrl = "../article/card.php";
+									doing +=
+										"<a href='../article/?id=" + iterator.res_id + "' target='_blank'>预览</a>";
+									doing +=
+										"<a href='../article/my_article_edit.php?id=" +
+										iterator.res_id +
+										"' target='_blank'>编辑</a>";
 									break;
 								case 4: //collection
 									break;
@@ -220,10 +237,10 @@ function group_list(id, list) {
 									break;
 							}
 							html += "</div>";
-							html +=
-								"<div style='flex:1;'><a href='../studio/project.php?op=open&doc_id=" +
-								iterator.doc_id +
-								"'>打开</a></div>";
+							html += "<div style='flex:1;'>";
+							//可用的操作
+							html += doing;
+							html += "</div>";
 							html += "</div>";
 						}
 					} else {

+ 2 - 1
app/group/index.php

@@ -90,6 +90,7 @@ require_once '../studio/index_head.php';
 						<div id='group_add_div' class="float_dlg"></div>
 					</span>
 
+<!--
 					<span id="button_new_sub_group" class="icon_btn_div">
 						<span class="icon_btn_tip"><?php echo $_local->gui->new_sub_group;?></span>
 						<button id="file_add" type="button" class="icon_btn" title=" "  onclick="group_add_dlg_show()">
@@ -99,7 +100,7 @@ require_once '../studio/index_head.php';
 						</button>
 						<div id='sub_group_add_div' class="float_dlg"></div>
 					</span>
-
+-->
 					<span id="delete" class="icon_btn_div">				
 						<span class="icon_btn_tip"><?php echo $_local->gui->recycle_bin;?></span>
 						<button id="to_recycle" type="button" class="icon_btn" onclick="file_del()" title=" ">

+ 5 - 4
app/share/coop_get.php

@@ -10,10 +10,11 @@ require_once '../group/function.php';
 if(isset($_GET["res_id"])){
     PDO_Connect(_FILE_DB_USER_SHARE_);
     $id=$_GET["res_id"];
-    $query = "SELECT * FROM share_cooperator  WHERE res_id = ? ";
-	$Fetch = PDO_FetchAll($query,array($id));
+    $type=$_GET["res_type"];
+    $query = "SELECT * FROM share_cooperator  WHERE res_id = ? and res_type=? ";
+	$Fetch = PDO_FetchAll($query,array($id,$type));
 
-	#获取协作者
+	#获取协作者名字
 	if(count($Fetch)>0){
 		$user_info = new UserInfo();
 		$group_info = new GroupInfo();
@@ -24,7 +25,7 @@ if(isset($_GET["res_id"])){
 					$Fetch[$key]["user"] = $user_info->getName($value["cooperator_id"]);
 					break;
 				case 1:
-					# 小组作者
+					# 小组作者
 					$Fetch[$key]["user"] = $group_info->getName($value["cooperator_id"]);
 					$Fetch[$key]["parent_name"] = $group_info->getName($group_info->getParentId($value["cooperator_id"]));
 					break;

+ 0 - 1
app/share/function.php

@@ -84,7 +84,6 @@ function share_res_list_get($userid,$res_type=-1){
 					$resList[$key]["status"]="0";
 					$resList[$key]["lang"]="unkow";
 				}
-				
 				break;
 			case 3:
 				# 3 Article 文章

+ 18 - 44
app/share/share.js

@@ -3,14 +3,15 @@ var _res_type;
 var gUserList = new Array();
 
 function share_load(id, type) {
-	refresh_coop_list(id);
+	refresh_coop_list(id, type);
 }
 
-function refresh_coop_list(id) {
+function refresh_coop_list(id, type) {
 	$.get(
 		"../share/coop_get.php",
 		{
 			res_id: id,
+			res_type: type,
 		},
 		function (data, status) {
 			if (status == "success") {
@@ -126,30 +127,17 @@ function render_user_list() {
 	let html = "<ul>";
 	let arrIndex = 0;
 	for (const iterator of gUserList) {
-		html += "<li> <a class='btn_del' onclick=\"userlist_del(' + arrIndex + ')\">删除</a>" + iterator.name;
+		html += "<li>";
+		html += "<span>";
 		if (iterator.type == 1) {
-			//如果是小组,显示项目列表
-			html += "<div>";
-			html +=
-				"<div><input id='prj_" +
-				iterator.id +
-				"' checked type='radio' name='prj_" +
-				iterator.id +
-				"' />全组成员</div>";
-			if (typeof iterator.project != "undefined") {
-				for (const project of iterator.project) {
-					html +=
-						"<div><input id='prj_" +
-						project.id +
-						"' type='radio' name='prj_" +
-						iterator.id +
-						"' />" +
-						project.name +
-						"</div>";
-				}
-			}
-			html += "</div>";
+			//小组
+			html += "👥";
+		} else {
+			html += "👤";
 		}
+		html += iterator.name;
+		html += "</span>";
+		html += "<a class='btn_del' onclick=\"userlist_del(' + arrIndex + ')\">删除</a>";
 		html += "</li>";
 		arrIndex++;
 	}
@@ -241,6 +229,8 @@ function username_search(keyword, type) {
 function add_coop() {
 	let coopList = new Array();
 	for (const itUser of gUserList) {
+		coopList.push({ id: itUser.id, type: itUser.type });
+		/*
 		if (itUser.type == 0) {
 			coopList.push({ id: itUser.id, type: itUser.type });
 		} else if (itUser.type == 1) {
@@ -257,6 +247,7 @@ function add_coop() {
 				}
 			}
 		}
+		*/
 	}
 	$.post(
 		"../share/coop_put.php",
@@ -270,7 +261,7 @@ function add_coop() {
 			cancel_coop();
 			let result = JSON.parse(data);
 			if (parseInt(result.status) == 0) {
-				refresh_coop_list(_res_id);
+				refresh_coop_list(_res_id, _res_type);
 			} else {
 				alert(result.message);
 			}
@@ -300,7 +291,7 @@ function coop_remove(userid, username) {
 				cancel_coop();
 				let result = JSON.parse(data);
 				if (parseInt(result.status) == 0) {
-					refresh_coop_list(_res_id);
+					refresh_coop_list(_res_id, _res_type);
 				} else {
 					alert(result.message);
 				}
@@ -323,7 +314,7 @@ function coop_set_power(userid, power) {
 				cancel_coop();
 				let result = JSON.parse(data);
 				if (parseInt(result.status) == 0) {
-					refresh_coop_list(_res_id);
+					refresh_coop_list(_res_id, _res_type);
 				} else {
 					alert(result.message);
 				}
@@ -331,20 +322,3 @@ function coop_set_power(userid, power) {
 		);
 	}
 }
-
-function get_group_project(id) {
-	$.get(
-		"../group/get.php",
-		{
-			id: id,
-		},
-		function (data, status) {
-			let result = JSON.parse(data);
-			if (parseInt(result.status) == 0) {
-				refresh_coop_list(_res_id);
-			} else {
-				alert(result.message);
-			}
-		}
-	);
-}

+ 9 - 3
app/share/share.php

@@ -6,7 +6,7 @@ require_once '../studio/index_head.php';
 <script language="javascript" src="../share/share.js"></script>
 <style>
 .item_block{
-	border-top: 1px solid var(--border-line-color);
+	border-bottom: 1px solid var(--border-line-color);
     padding: 0 0 2em 0;
 }
 #coop_new_tools{
@@ -41,12 +41,13 @@ input[type="text"], input[type="input"], input[type="password"], textarea{
     width: 28px;
 }
 #user_list li{
-    border: 1px solid var(--btn-border-color);
+    border-bottom: 1px solid var(--btn-border-color);
     width: 270px;
     border-radius: 5px;
     line-height: 24px;
     padding: 0 5px;
-
+	display:flex;
+	justify-content: space-between;
 }
 #user_list li>.btn_del{
 	visibility: hidden;
@@ -56,6 +57,11 @@ input[type="text"], input[type="input"], input[type="password"], textarea{
 }
 </style>
 <div class=" " >
+	<div class="item_block" style="display:none;">
+		<h2 id="res_type"></h2>
+		<div id="res_title">
+		</div>
+	</div>
 	<div class="item_block">
 		<h2>隐私设置</h2>
 		<ul>

+ 3 - 1
app/studio/index_tool_bar.php

@@ -110,7 +110,9 @@
 
 				<li id="article"  onclick="goto_url(this,'../article/my_article_index.php')">
 					<span  class="navi_icon">
-						<svg t="1603167726865" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3914" width="32" height="32"><path d="M927.873506 253.409882H768V160.018071C768 71.806494 696.193506 0 607.981929 0H160.015059C71.661929 0 0.144565 71.661929 0 160.018071V863.984941C0 952.193506 71.806494 1024 160.018071 1024h702.238117l0.572236-0.144565 1.153505 0.144565C952.193506 1024 1024 952.193506 1024 863.981929V349.536376c-0.144565-53.097412-43.026071-95.984941-96.126494-96.126494zM525.239718 602.515576H205.203576c-17.700141 0-31.945788-14.390212-31.945788-31.945788 0-17.700141 14.390212-31.9488 31.945788-31.9488h320.036142c17.700141 0 31.945788 14.390212 31.945788 31.9488 0 17.697129-14.245647 31.945788-31.945788 31.945788z m0-159.873505H205.203576c-17.700141 0-31.945788-14.390212-31.945788-31.945789 0-17.700141 14.390212-31.9488 31.945788-31.9488h320.036142c17.700141 0 31.945788 14.390212 31.945788 31.9488 0 17.555576-14.245647 31.945788-31.945788 31.945789z m0-160.021083H205.203576c-17.700141 0-31.945788-14.3872-31.945788-31.945788 0-17.697129 14.390212-31.945788 31.945788-31.945788h320.036142c17.700141 0 31.945788 14.390212 31.945788 31.945788 0 17.558588-14.245647 31.945788-31.945788 31.945788z m434.724141 581.360941c0 52.811294-43.026071 95.984941-95.984941 95.984942-52.952847 0-95.978918-43.173647-95.978918-95.984942V317.446024h160.015059c17.703153 0 31.9488 14.390212 31.9488 31.945788v514.590117z" p-id="3915"></path></svg>	
+					<svg class="icon">
+					<use xlink:href="../studio/svg/icon.svg#article-1"></use>
+					</svg>	
 					</span>	
 					<span class="navi_text">
 					<?php echo $_local->gui->text."DIY";?>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
app/studio/svg/icon.svg


+ 1 - 4
app/term/channal_list.php

@@ -35,7 +35,7 @@ $channel_power=array();
 if (isset($_COOKIE["userid"])) {
 	//找自己的
     PDO_Connect(_FILE_DB_CHANNAL_);
-    $query = "SELECT id from channal where owner = ?   limit 0,100";
+    $query = "SELECT id from channal where owner = ? and status >0   limit 0,100";
     $Fetch_my = PDO_FetchAll($query, array($_COOKIE["userid"]));
     foreach ($Fetch_my as $key => $value) {
         # code...
@@ -54,9 +54,6 @@ if (isset($_COOKIE["userid"])) {
 			}
 		}
 	}
-
-    
-
 }
 if (count($channal_list) > 0) {
 	#  创建一个填充了和params相同数量占位符的字符串 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio