Skip to content

Commit

Permalink
Merge pull request #1764 from Leantime/release-fixes
Browse files Browse the repository at this point in the history
Fixed multiple release issues
  • Loading branch information
marcelfolaron authored Jul 22, 2023
2 parents 3a9f13f + ffc36f1 commit 8cda6c3
Show file tree
Hide file tree
Showing 24 changed files with 111 additions and 42 deletions.
2 changes: 0 additions & 2 deletions app/core/class.events.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ public static function discover_listeners()
$enabledPlugins = $pluginService->getEnabledPlugins();
}

//var_dump($enabledPlugins); exit;

foreach ($enabledPlugins as $plugin) {
if (file_exists($pluginPath . $plugin->foldername . "/register.php")) {
include $pluginPath . $plugin->foldername . "/register.php";
Expand Down
1 change: 0 additions & 1 deletion app/domain/api/controllers/class.users.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function get($params)
}

if (isset($params["profileImage"])) {
//var_dump("asdf");

$return = $this->usersService->getProfilePicture($params["profileImage"]);

Expand Down
2 changes: 1 addition & 1 deletion app/domain/menu/js/menuController.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ leantime.menuController = (function () {

var activeProgramParent = jQuery(".programList .activeChild").attr("data-program-id");
var activeStrategyParent = jQuery(".strategyList .activeChild").attr("data-strategy-id");
var activeParent = '';
var activeParent = 'noparent';

if(activeStrategyParent !== undefined && activeStrategyParent !== ''){
activeParent = activeStrategyParent;
Expand Down
20 changes: 4 additions & 16 deletions app/domain/pageparts/js/generalController.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ leantime.generalController = (function () {
width: "100%",
skin_url: leantime.appUrl + '/assets/css/libs/tinymceSkin/oxide',
content_css: leantime.appUrl + '/theme/' + leantime.theme + '/css/theme.css,'
+ leantime.appUrl + '/assets/css/libs/tinymceSkin/oxide/content.css,'
+ leantime.appUrl + '/assets/css/components/wysiwyg-overrides.css,'
+ leantime.appUrl + '/assets/css/libs/roboto.css',
+ leantime.appUrl + '/dist/css/editor.' + leantime.version + '.min.css',
content_style: "body.mce-content-body{ font-size:14px; } img { max-width: 100%; }",
plugins : "imagetools,shortlink,checklist,table,emoticons,autolink,image,lists,save,media,searchreplace,paste,directionality,fullscreen,noneditable,visualchars,advlist,mention,slashcommands",
toolbar : "bold italic strikethrough | link unlink image | checklist bullist numlist | emoticons",
Expand Down Expand Up @@ -195,8 +193,6 @@ leantime.generalController = (function () {

var placeholder = editor.getDoc().getElementsByClassName("tinyPlaceholder");

console.log(placeholder);

if (placeholder.length > 0) {

while(placeholder[0]) {
Expand All @@ -205,7 +201,6 @@ leantime.generalController = (function () {
}
editor.save();

console.log(editor.getDoc());
}
});
}
Expand All @@ -227,13 +222,8 @@ leantime.generalController = (function () {
// General options
width: "100%",
skin_url: leantime.appUrl + '/assets/css/libs/tinymceSkin/oxide',
content_css: leantime.appUrl + '/assets/css/components/style.default.css,'
+ leantime.appUrl + '/assets/css/components/dropdowns.css,'
+ leantime.appUrl + '/assets/css/libs/bootstrap-grid.min.css,'
+ leantime.appUrl + '/theme/' + leantime.theme + '/css/theme.css,'
+ leantime.appUrl + '/assets/css/libs/tinymceSkin/oxide/content.css,'
+ leantime.appUrl + '/assets/css/components/wysiwyg-overrides.css,'
+ leantime.appUrl + '/assets/css/libs/roboto.css',
content_css: leantime.appUrl + '/theme/' + leantime.theme + '/css/theme.css,'
+ leantime.appUrl + '/dist/css/editor.' + leantime.version + '.min.css',
content_style: "body.mce-content-body{ font-size:14px; } img { max-width: 100%; }",
plugins : "imagetools,embed,autoresize,shortlink,checklist,bettertable,table,emoticons,autolink,image,lists,save,media,searchreplace,paste,directionality,fullscreen,noneditable,visualchars,advancedTemplate,advlist,codesample,mention,slashcommands",
toolbar : "bold italic strikethrough | formatselect forecolor | alignleft aligncenter alignright | link unlink image media embed emoticons | checklist bullist numlist | table | codesample | advancedTemplate",
Expand Down Expand Up @@ -386,9 +376,7 @@ leantime.generalController = (function () {
width: "100%",
skin_url: leantime.appUrl + '/assets/css/libs/tinymceSkin/oxide',
content_css: leantime.appUrl + '/theme/' + leantime.theme + '/css/theme.css,'
+ leantime.appUrl + '/assets/css/libs/tinymceSkin/oxide/content.css,'
+ leantime.appUrl + '/assets/css/components/wysiwyg-overrides.css,'
+ leantime.appUrl + '/assets/css/libs/roboto.css',
+ leantime.appUrl + '/dist/css/editor.' + leantime.version + '.min.css',
content_style: "body.mce-content-body{ font-size:14px; } img { max-width: 100%; }",
height:"400",
content_style: "body.mce-content-body{ font-size:14px; } img { max-width: 100%; }",
Expand Down
1 change: 1 addition & 0 deletions app/domain/pageparts/templates/header.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<meta name="theme-color" content="<?php $this->e($_SESSION["companysettings.primarycolor"]) ?>">
<meta name="color-scheme" content="<?php $this->e($theme ?? 'default') ?>">
<meta name="identifier-URL" content="<?=BASE_URL?>">
<meta name="leantime-version" content="<?=$settings->appVersion ?>">
<?php $this->dispatchTplEvent('afterMetaTags'); ?>

<link rel="shortcut icon" href="<?=BASE_URL?>/dist/images/favicon.png"/>
Expand Down
4 changes: 3 additions & 1 deletion app/domain/projects/controllers/class.newProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function run()
'state' => $_POST['projectState'],
'psettings' => $_POST['globalProjectUserAccess'],
'menuType' => $_POST['menuType'] ?? 'default',
'type' => 'project',
'type' => $_POST['type'] ?? 'project',
'parent' => $_POST['parent'] ?? '',
'start' => $this->language->getISODateString($_POST['start']),
'end' => $_POST['end'] ? $this->language->getISODateString($_POST['end']) : ''
Expand Down Expand Up @@ -150,6 +150,8 @@ public function run()
$this->tpl->assign('project', $values);
$this->tpl->assign('availableUsers', $this->userRepo->getAll());
$this->tpl->assign('clients', $this->clientsRepo->getAll());
$this->tpl->assign('projectTypes', $this->projectService->getProjectTypes());

$this->tpl->assign('info', $msgKey);

$this->tpl->display('projects.newProject');
Expand Down
3 changes: 3 additions & 0 deletions app/domain/projects/controllers/class.showProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public function run()
{

if (isset($_GET['id']) === true) {
$projectTypes = $this->projectService->getProjectTypes();

$id = (int)($_GET['id']);

//Mattermost integration
Expand Down Expand Up @@ -330,6 +332,7 @@ public function run()
$this->tpl->assign('numComments', $this->commentsRepo->countComments('project', $_GET['id']));

$this->tpl->assign('menuTypes', $this->menuRepo->getMenuTypes());
$this->tpl->assign('projectTypes', $projectTypes);

$this->tpl->assign('state', $this->projectRepo->state);
$this->tpl->assign('role', $_SESSION['userdata']['role']);
Expand Down
14 changes: 10 additions & 4 deletions app/domain/projects/repositories/class.projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function __construct()
$this->db = core\db::getInstance();
}


/**
* getAll - get all projects open and closed
*
Expand Down Expand Up @@ -612,6 +613,7 @@ public function editProject(array $values, $id)
dollarBudget = :dollarBudget,
psettings = :psettings,
menuType = :menuType,
type = :type,
parent = :parent,
start = :start,
end = :end
Expand All @@ -629,6 +631,7 @@ public function editProject(array $values, $id)
$stmn->bindValue('dollarBudget', $values['dollarBudget'], PDO::PARAM_STR);
$stmn->bindValue('psettings', $values['psettings'], PDO::PARAM_STR);
$stmn->bindValue('menuType', $values['menuType'], PDO::PARAM_STR);
$stmn->bindValue('type', $values['type'] ?? 'project', PDO::PARAM_STR);
$stmn->bindValue('id', $id, PDO::PARAM_STR);
$stmn->bindValue('parent', $values['parent'] ?? null, PDO::PARAM_STR);

Expand Down Expand Up @@ -1131,12 +1134,15 @@ public function getProjectAvatar($id)
->font(ROOT . '/dist/fonts/roboto/Roboto-Regular.woff2')
->fontSize(0.5)
->size(96)
->background('#555555')->color("#fff")
->generate();
->background('#555555')->color("#fff");

$image->save(APP_ROOT."/cache/avatars/".$imagename.".png", 100, "png");
if(is_writable(APP_ROOT."/cache/avatars/")) {
$image->generate()->save(APP_ROOT . "/cache/avatars/" . $imagename . ".png", 100, "png");
return array("filename"=>APP_ROOT."/cache/avatars/".$imagename.".png", "type"=>"generated");
}else{

return array("filename"=>APP_ROOT."/cache/avatars/".$imagename.".png", "type"=>"generated");
return $image->generateSVG();;
}

}

Expand Down
22 changes: 22 additions & 0 deletions app/domain/projects/services/class.projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ public function __construct()
$this->notificationService = new notifications();
}

public function getProjectTypes() {

$types = array("project"=>"label.project");

$filtered = static::dispatch_filter("filterProjectType", $types);

//Strategy & Program are protected types
if(isset($filtered["strategy"])){
unset($filtered["strategy"]);
}

if(isset($filtered["program"])){
unset($filtered["program"]);
}

return $filtered;
}

public function getProject($id)
{
return $this->projectRepository->getProject($id);
Expand Down Expand Up @@ -320,6 +338,10 @@ public function getProjectHierarchyAssignedToUser($userId, $projectStatus = "ope
//IF the pgm module is not active, add all items
if($projectHierarchy['program']["enabled"] === false) {
if ($project['type'] != "program" && $project['type'] != "strategy") {

if($project['parent'] == 0 || $project['parent'] == '' || $project['parent'] == null){
$project['parent'] = "noparent";
}
$projectHierarchy["project"]["items"]['project'][$project['id']] = $project;
}
} else {
Expand Down
13 changes: 13 additions & 0 deletions app/domain/projects/templates/newProject.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@

<div class="span4">

<?php if($this->get('projectTypes') && count($this->get('projectTypes')) > 1) {?>
<h4 class="widgettitle title-light"><i class="fa-regular fa-rectangle-list"></i> Project Type</h4>
<p>The type of the project. This will determine which features are available.</p>
<select name="type">
<?php foreach($this->get('projectTypes') as $key => $type){ ?>
<option value="<?=$this->escape($key)?>"
<?php if($project['type'] == $key) echo " selected='selected' "; ?>
><?=$this->__($this->escape($type))?></option>
<?php } ?>
</select>
<br /><br />
<?php } ?>

<?php $this->dispatchTplEvent("beforeClientPicker", $project) ?>

<div class="row-fluid marginBottom">
Expand Down
15 changes: 15 additions & 0 deletions app/domain/projects/templates/submodules/projectDetails.sub.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@
<div class="span4">

<div class="row-fluid marginBottom">

<?php if($this->get('projectTypes') && count($this->get('projectTypes')) > 1) {?>
<h4 class="widgettitle title-light"><i class="fa-regular fa-rectangle-list"></i> Project Type</h4>
<p>The type of the project. This will determine which features are available.</p>
<select name="type">
<?php foreach($this->get('projectTypes') as $key => $type){ ?>
<option value="<?=$this->escape($key)?>"
<?php if($project['type'] == $key) echo " selected='selected' "; ?>
><?=$this->__($this->escape($type))?></option>
<?php } ?>
</select>
<br /><br />
<?php } ?>


<h4 class="widgettitle title-light"><span
class="fa fa-picture-o"></span><?php echo $this->__('label.project_avatar'); ?></h4>
<div class="span12 center">
Expand Down
1 change: 0 additions & 1 deletion app/domain/tickets/js/ticketsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,6 @@ leantime.ticketsController = (function () {
data: statusPostData

}).done(function(response){
console.log(response);
leantime.handleAsyncResponse(response);
});

Expand Down
12 changes: 7 additions & 5 deletions app/domain/users/repositories/class.users.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,13 +649,15 @@ public function getProfilePicture($id)
->font(ROOT . '/dist/fonts/roboto/Roboto-Regular.woff2')
->fontSize(0.5)
->size(96)
->background('#81B1A8')->color("#fff")
->generate();
->background('#81B1A8')->color("#fff");

$image->save(APP_ROOT."/cache/avatars/".$imagename.".png", 100, "png");

return array("filename"=>APP_ROOT."/cache/avatars/".$imagename.".png", "type"=>"generated");
if(is_writable(APP_ROOT."/cache/avatars/")) {
$image->generate()->save(APP_ROOT."/cache/avatars/".$imagename.".png", 100, "png");
return array("filename"=>APP_ROOT."/cache/avatars/".$imagename.".png", "type"=>"generated");
}else{

return $image->generateSVG();
}
}


Expand Down
2 changes: 1 addition & 1 deletion config/appSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class appSettings
{

public $appVersion = "2.3.26";
public $appVersion = "2.3.27";

public $dbVersion = "2.1.21";

Expand Down
2 changes: 1 addition & 1 deletion config/configuration.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class config
public $sitename = 'Leantime'; //Name of your site, can be changed later
public $language = 'en-US'; //Default language
public $logoPath = '/dist/images/logo.svg'; //Default logo path, can be changed later
public $printLogoURL = '/dist/images/logo.jpg'; //Default logo URL use for printing (must be jpg or png format)
public $printLogoURL = '/dist/images/logo.png'; //Default logo URL use for printing (must be jpg or png format)
public $appUrl = ''; //Base URL, trailing slash not needed
public $appUrlRoot = ''; //Base of application withotu trailing slash (used for cookies), e.g, /leantime
public $defaultTheme = 'default'; //Default theme
Expand Down
2 changes: 1 addition & 1 deletion config/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LEAN_LOG_PATH = '' # Default Log Path (including

## Look & Feel, these settings are available in the UI and can be overwritten there.
LEAN_LOGO_PATH = '/dist/images/logo.svg' # Default logo path, can be changed later
LEAN_PRINT_LOGO_URL = '/images/logo.jpg' # Default logo URL use for printing (must be jpg or png format)
LEAN_PRINT_LOGO_URL = '/dist/images/logo.png' # Default logo URL use for printing (must be jpg or png format)
LEAN_DEFAULT_THEME = 'default' # Default theme
LEAN_PRIMARY_COLOR = '#1b75bb' # Primary Theme color
LEAN_SECONDARY_COLOR = '#81B1A8' # Secondary Theme Color
Expand Down
6 changes: 6 additions & 0 deletions logs/error.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[22-Jul-2023 06:52:58 America/Los_Angeles] cron start
[22-Jul-2023 06:52:58 America/Los_Angeles] cron end
[22-Jul-2023 07:02:37 America/Los_Angeles] cron start
[22-Jul-2023 07:02:37 America/Los_Angeles] cron end
[22-Jul-2023 07:11:15 America/Los_Angeles] cron start
[22-Jul-2023 07:11:15 America/Los_Angeles] cron end
2 changes: 2 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ package: build
cp ./config/configuration.sample.php $(TARGET_DIR)/config
cp ./config/sample.env $(TARGET_DIR)/config
mkdir -p $(TARGET_DIR)/logs
mkdir -p $(TARGET_DIR)/cache
mkdir -p $(TARGET_DIR)/cache/avatars
touch $(TARGET_DIR)/logs/.gitkeep
cp -R ./public $(TARGET_DIR)
mkdir -p $(TARGET_DIR)/userfiles
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leantime",
"version": "2.3.26",
"version": "2.3.27",
"description": "Open source innovation management system",
"dependencies": {
"@assuradeurengilde/fontawesome-iconpicker": "^3.2.3",
Expand Down
4 changes: 3 additions & 1 deletion public/assets/js/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ leantime.theme = theme;
var appURL = jQuery('meta[name=identifier-URL]').attr("content");
leantime.appUrl = appURL;

var leantimeVersion = jQuery('meta[name=leantime-version]').attr("content");
leantime.version = leantimeVersion;

//Backwards compatibility for some jQuery libs
jQuery(function() {
jQuery.fn.size = function() {
Expand Down Expand Up @@ -72,7 +75,6 @@ jQuery(document).ready(function(){
leantime.handleAsyncResponse = function(response) {

if(response !== undefined) {
console.log(response);
if(response.result !== undefined && response.result.html !== undefined){

var content = jQuery(response.result.html);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1435,8 +1435,14 @@ jQuery(function($, undefined) {


e.preventDefault();
nm.opener.append("<input type='hidden' name='submitAction' value='"+e.originalEvent.submitter.value+"' />")
console.log(e);
let submitAction = "";
if(e && e.originalEvent &&
e.originalEvent.submitter && e.originalEvent.submitter.value) {
submitAction = e.originalEvent.submitter.value;
}

nm.opener.append("<input type='hidden' name='submitAction' value='" + submitAction + "' />")
nm.opener.trigger('nyroModal');
});
},
Expand Down
6 changes: 1 addition & 5 deletions public/assets/js/libs/simpleGantt/frappe-gantt.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions public/assets/less/editor.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

@import "~css/components/style.default.css";
@import "~css/components/dropdowns.css";
@import "~css/libs/bootstrap-grid.min.css";
@import "~css/libs/tinymceSkin/oxide/content.css";
@import "~css/libs/roboto.css";
@import "~css/components/wysiwyg-overrides.css";

1 change: 1 addition & 0 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ mix
"./public/assets/js/libs/uppy/uppy.js",
], `public/dist/js/compiled-extended-libs.${version}.min.js`)
.less('./public/assets/less/main.less', `public/dist/css/main.${version}.min.css`)
.less('./public/assets/less/editor.less', `public/dist/css/editor.${version}.min.css`)
.copy('./public/assets/images', 'public/dist/images')
.copy('./public/assets/fonts', 'public/dist/fonts')
.eslint({
Expand Down

0 comments on commit 8cda6c3

Please sign in to comment.