Skip to content

Commit

Permalink
#397 - Show entrypoint in web project list.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Dec 7, 2021
1 parent 9400067 commit 55b8ef7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/app/scripts/php/libs/WebProject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function showProjects($detailPageId = false, $editable = false) {
$actionUrl = $webObject->composeUrl($detailPageId);
}

$projects = $dbObject->fetchAll('SELECT DISTINCT `web_project`.`id`, `web_project`.`name` FROM `web_project` LEFT JOIN `web_project_right` ON `web_project`.`id` = `web_project_right`.`wp` LEFT JOIN `group` ON `web_project_right`.`gid` = `group`.`gid` WHERE `web_project_right`.`type` = ' . WEB_R_WRITE . ' AND (`group`.`gid` IN (' . $loginObject->getGroupsIdsAsString() . ') OR `group`.`parent_gid` IN (' . $loginObject->getGroupsIdsAsString() . ')) ORDER BY `id`;');
$projects = $dbObject->fetchAll('SELECT DISTINCT `web_project`.`id`, `web_project`.`name`, `web_project`.`entrypoint` FROM `web_project` LEFT JOIN `web_project_right` ON `web_project`.`id` = `web_project_right`.`wp` LEFT JOIN `group` ON `web_project_right`.`gid` = `group`.`gid` WHERE `web_project_right`.`type` = ' . WEB_R_WRITE . ' AND (`group`.`gid` IN (' . $loginObject->getGroupsIdsAsString() . ') OR `group`.`parent_gid` IN (' . $loginObject->getGroupsIdsAsString() . ')) ORDER BY `id`;');

if (count($projects) == 0) {
$return .= parent::getWarning($rb->get('project.nodata'));
Expand All @@ -154,6 +154,7 @@ public function showProjects($detailPageId = false, $editable = false) {
. '<th class="th-id">' . $rb->get('project.id') . ':</th>'
. '<th class="th-name">' . $rb->get('project.name') . ':</th>'
. '<th class="th-url">' . $rb->get('project.url') . ':</th>'
. '<th class="th-entrypoint">' . $rb->get('project.entrypoint') . ':</th>'
. (($editable == "true") ? '' . '<th class="th-edit"></th>' : '')
. '</tr>'
. '</thead>'
Expand Down Expand Up @@ -189,14 +190,24 @@ public function showProjects($detailPageId = false, $editable = false) {
$project['url'] = UrlResolver::combinePath($project['url'], $url['root_url']);
$project['url'] = UrlResolver::combinePath($project['url'], $url['virtual_url']);

if (!empty($project["entrypoint"])) {
$parts = explode(":", $project["entrypoint"], 2);
$module = Module::findById($parts[0]);
if ($module != null) {
$parts[0] = $module->alias;
}

$project["entrypoint"] = implode(":", $parts);
}

$pages = $dbObject->fetchAll('SELECT `id` FROM `page` WHERE `wp` = ' . $project['id'] . ' LIMIT 1;');
if ($ok == true) {
$return .= ''
. '<tr class="' . ((($i % 2) == 0) ? 'even' : 'idle') . '">'
. '<td class="td-id">' . $project['id'] . '</td>'
. '<td class="td-name">' . $project['name'] . '</td>'
. '<td class="td-url"><a target="_blank" href="' . $project['url'] . '">' . $project['url'] . '</a></td>'
//. '<td class="td-url">' . '<a target="_blank" href="' . (($project['http'] == 1) ? 'http://' : 'https://') . $project['url'] . '">view</a>' . '</td>'
. '<td class="td-entrypoint">' . $project["entrypoint"] . '</td>'
. '<td class="td-edit">'
. (($editable == "true") ? ''
. '<form name="edit-projects1" method="post" action="' . $actionUrl . '"> '
Expand Down

0 comments on commit 55b8ef7

Please sign in to comment.