News:

Looking for a good read? Check out the SimpleDesk Team Blog.

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - venguard223

#31
QuoteI think Wedge does that (or they do a lot of manual posting

Manual posting, baby!

QuoteIt was just a thought.  I toy with many ideas in my head.  Some of them are great, others are not.

Yeah, I know that feeling only too well.

QuoteMy thoughts on it mostly would be that it would make it much easier to work with since we got a almost standalone install.

The problem with it is that you end up having to reduplicate a ton of stuff. For example you'd pretty much need to handle attachments yourself with all the joys of things like file permissions. By bootstrapping it with the existing attachments system (for example) there's no duplication and much lower support overhead.

QuoteIts not like plugin manager can't still scan the packages directory or do the LE.

If only that's what it actually did. The plugin manager still relies on the packages system to actually perform installs etc. and the language editor is a direct integration of the SD files.

QuoteMy thoughts where you would be able to decompress it into a directory, run the installer which would setup a settings file with the link to SMF SSI.php, and a few other basic settings and off you go.

Yeah, that'd be the ideal except it means a massive rewrite and all kinds of support issues that were never support issues in the first place even assuming the rewrite doesn't generate new bugs.

QuoteI've also toyed with the idea of seeing what we could do to start a abstraction layer, so SMF isn't the only source it will work on but other forks such as Wedge could use SimpleDesk.

No chance it's going to work on Wedge. I did make the port to Wedge and mostly it worked last time I tested it, even allowing for all the bazillions of changes in our markup. But I realised ultimately that I want to rewrite from scratch for Wedge to fix some of the architectural issues that are present (e.g. being able to assign multiple people to a ticket and the mess that is the current 'items to do' count for each user), plus there's things like the Wedge notifications system that can be used now.
#32
You and me both as far as Github is concerned... I know that there is some stuff in there for SMF 2.1 compatibility but I have no idea what the state of it is any more :(

Oh, I just realised something else; if SD were pushed into an SSI only context, might as well remove the plugin manager and edits to the language editor since neither will work properly in that situation, especially the plugin manager.
#33
Bugs - see http://www.simpledesk.net/community/index.php?topic=1315.0 and http://www.simpledesk.net/community/index.php?topic=1316.0

As far as SSI integration goes, yes, you could rewrite most of the guts to hang off hooks. Have fun rewriting the attachments system though I guess just cloning action=dlattach would be easier.

Thing is... the actual changes to SMF itself are surprisingly light, I already converted much of it to hooks the first time around. The real pains in the posterior to change, though, are the board index (since that's fugly as sin), attachments (while you can hive a lot of it off to its own action handler for serving attachments, the changes to the backend are a bit of a different beast), track IP integration (unless there's a hook).

There are no real integration points with topics, and IIRC the menu is driven by a hook anyway (though disabled mostly in SSI mode for performance again IIRC)

The other thing is if you make it powered by SSI rather than the action handler, you're going to have SO much fun rewriting everything to not be referencing the action handler. Everything was pulled under action=helpdesk for a reason ;)

The other other thing with going the SSI route is that standalone mode mostly becomes pointless and/or bordering on impossible to implement sanely. I'm still not impressed, by the way, that the SA KB mod 'borrowed' large chunks of that code without a credit even if SD was BSD and allowed them to reuse the code.
#34
I don't have time to look into it right now but I'll look at it when I get home (which will be tomorrow now)
#36
Yeah, that's the only thing you'd have to change, everything else around that number. I initially had it at 50 but that seemed too many for my liking.

Good that it all works for you.
#37
The profile area showing the entire editing history of someone can be pretty cool. Not so cool if you get a white screen of death because too much memory got eaten in PHP.

So, let's fix that with some pagination. Bit more complex a fix this, two files needed.

Firstly, SimpleDesk-Profile.php

Code (find) Select
function shd_profile_actionlog($memID)
{
global $context, $txt, $scripturl, $sourcedir, $user_info, $settings;

loadTemplate('sd_template/SimpleDesk-Profile');
shd_load_language('sd_language/SimpleDeskProfile');

require_once($sourcedir . '/sd_source/Subs-SimpleDeskAdmin.php');
$context['action_log'] = shd_load_action_log_entries(0, 10, '', '', 'la.id_member = ' . $memID);
$context['action_log_count'] = shd_count_action_log_entries('la.id_member = ' . $memID);
$context['action_full_log'] = allowedTo('admin_forum') || shd_allowed_to('admin_helpdesk', 0);

$context['page_title'] = $txt['shd_profile_area'] . ' - ' . $txt['shd_profile_actionlog'];
$context['sub_template'] = 'shd_profile_actionlog';

}


(your copy may or may not have that odd empty line... just replace the entire function definition)

Code (replace) Select
function shd_profile_actionlog($memID)
{
global $context, $txt, $scripturl, $sourcedir, $user_info, $settings;

loadTemplate('sd_template/SimpleDesk-Profile');
shd_load_language('sd_language/SimpleDeskProfile');

require_once($sourcedir . '/sd_source/Subs-SimpleDeskAdmin.php');
$context['action_log_count'] = shd_count_action_log_entries('la.id_member = ' . $memID);
$context['displaypage'] = 30;
$context['start'] = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
if ($context['start'] < 0 || $context['start'] >= $context['action_log_count'])
$context['start'] = 0;
$context['action_log'] = shd_load_action_log_entries($context['start'], $context['displaypage'], '', '', 'la.id_member = ' . $memID);
$context['action_full_log'] = allowedTo('admin_forum') || shd_allowed_to('admin_helpdesk', 0);
$context['page_index'] = shd_no_expand_pageindex($scripturl . '?action=profile;area=hd_actionlog;u=' . $memID, $context['start'], $context['action_log_count'], $context['displaypage']);
$context['page_title'] = $txt['shd_profile_area'] . ' - ' . $txt['shd_profile_actionlog'];
$context['sub_template'] = 'shd_profile_actionlog';
}


This does the actual pagination under the hood. Now we have to display it.

SimpleDesk-Profile.template.php

function template_shd_profile_actionlog()
{
global $context, $settings, $txt, $scripturl;

echo '
<div class="tborder">
<div class="cat_bar grid_header">
<h3 class="catbg" id="ticket_log_header">
<img src="', $settings['default_images_url'], '/simpledesk/log.png" class="icon" alt="*" />
', sprintf($txt['shd_profile_log'], $context['member']['name']), '
<span class="smalltext">(', $context['action_log_count'] == 1 ? $txt['shd_profile_log_count_one'] : sprintf($txt['shd_profile_log_count_more'], $context['action_log_count']) , ')</span>
</h3>
</div>


Code (replace) Select
function template_shd_profile_actionlog()
{
global $context, $settings, $txt, $scripturl;

echo '
<div class="title_bar">
<h3 class="titlebg">
<span class="smalltext">', $txt['pages'], ': ', $context['page_index'], '</span>
</h3>
</div>
<div class="tborder">
<div class="cat_bar grid_header">
<h3 class="catbg" id="ticket_log_header">
<img src="', $settings['default_images_url'], '/simpledesk/log.png" class="icon" alt="*" />
', sprintf($txt['shd_profile_log'], $context['member']['name']), '
<span class="smalltext">(', $context['action_log_count'] == 1 ? $txt['shd_profile_log_count_one'] : sprintf($txt['shd_profile_log_count_more'], $context['action_log_count']) , ')</span>
</h3>
</div>


It's not pretty but it should give you pagination on the profile area log.
#38
tfs asked me to look at this, where large text custom fields were re-encoding br tags unnecessarily.

I'd submit a pull request to Github about this but I'm wary of doing it because I see other changes that I don't like the look of. But first, the SMF 2.0 / SD 2.0 changes. These should be good for any current version out there.

Very simple, one change to Subs-SimpleDeskPost.php, line 846 onwards.

Code (find) Select
if (isset($field_values[$row['id_field']]))
{
if ($context['ticket_form']['custom_fields'][$loc][$row['id_field']]['type'] == CFIELD_TYPE_MULTI)
$field_values[$row['id_field']] = explode(',', $field_values[$row['id_field']]);
$context['ticket_form']['custom_fields'][$loc][$row['id_field']]['value'] = $field_values[$row['id_field']];
}


Code (replace) Select
if (isset($field_values[$row['id_field']]))
{
if ($context['ticket_form']['custom_fields'][$loc][$row['id_field']]['type'] == CFIELD_TYPE_MULTI)
$field_values[$row['id_field']] = explode(',', $field_values[$row['id_field']]);
if ($context['ticket_form']['custom_fields'][$loc][$row['id_field']]['type'] == CFIELD_TYPE_LARGETEXT)
$field_values[$row['id_field']] = un_preparsecode($field_values[$row['id_field']]);
$context['ticket_form']['custom_fields'][$loc][$row['id_field']]['value'] = $field_values[$row['id_field']];
}


Just add those two lines before the final line of that block.


Now for what's in Github. Github looks like it's been modified for SMF 2.1 - I don't know if it's properly compatible, but I imagine it probably is since the work's been by emanuele.

The relevant block in Github is:
if (isset($field_values[$row['id_field']]))
{
if ($context['ticket_form']['custom_fields'][$loc][$row['id_field']]['type'] == CFIELD_TYPE_MULTI)
$field_values[$row['id_field']] = explode(',', $field_values[$row['id_field']]);

// Large text boxes may need fixing.
if ($context['ticket_form']['custom_fields'][$loc][$row['id_field']]['type'] == CFIELD_TYPE_LARGETEXT)
{
require_once($sourcedir . '/Subs-Editor.php');

$field_values[$row['id_field']] = html_to_bbc($field_values[$row['id_field']]);
}

$context['ticket_form']['custom_fields'][$loc][$row['id_field']]['value'] = $field_values[$row['id_field']];
}


I can only imagine that the html_to_bbc call is for the benefit of this fix, and that it should be what I've suggested above, however I don't know if other changes to the custom fields were made that meant it does have HTML parsing (I never gave it HTML parsing, only BBC parsing) so I don't want to submit a pull request in case it's irrelevant, but this is certainly something to think about.

I've tested this change locally and it works for me (and I can't seem to break it) but I can't believe I didn't spot it before somehow, there aren't any comments from me in the source reflecting it, put it that way.
#39
It should definitely be doable, even if it's a longer way around than would be desirable.

Let me know if you run into any problems.
#40
Sure you could, though you're going to have to do a little bit of legwork to do it.

For each department, you'll need separate groups for Analysts and Users, so Department 1 Analyst, Department 1 User etc.

You then need to define roles for these, so you define a user role in Department 1 which is attached to Department 1 User group.

Essentially what you're describing is doable but is not how I designed it to work, sorry.
#41
@SleePy: the problem with reducing dependencies is that you lose the one thing we wanted to keep in it originally - the theme system. The whole underpinning was that it wasn't just tying it to SMF to make it an SMF add-on but to reuse SMF as much as possible, so that you get all the benefits of using SMF with few of the drawbacks.

It'd be far nicer to do that than to have a separate system that just gets lightly integrated (which amounts to more overhead and more maintenance in the long run)

@tfs: Fixes probably aren't a huge deal if they're legitimate bugs. Shoot me a message on Wedge and I'll take a look when I'm able (I won't be back in front of my proper laptop until the start of August so after that shoot me a message and I'll see what I can do), while tweaks on the other hand are a different kettle of fish. I don't have time to do big enhancements but if they're the sort of thing I can crank out in a day or so I'm happy to get that sorted for you.
#42
What would be in it? What new features?

Github shows development is basically dead and has been since I left in 2011, with just bug fixes and some SMF 2.1 compatibility code since then.

ETA: Sadly I have neither the time nor motivation to pick it up, too much other stuff going on for that to happen now :(
#43
SimpleDesk Support / Re: Database Error
July 06, 2013, 08:49:26 PM
Yeah, topic solved has been broken a while.

Also, note that any future mods will likely have this same problem as it's yet another flaw in the package manager in SMF, it should really be enforcing a collation.
#44
I find it interesting that just about every support request is how to configure the permissions.

I shouldn't have done what I did with them, but I dunno, I couldn't think of anything that actually worked better... and in the two years since I wrote it, I still can't think of anything better to do the job that did.

But I feel bad for all the support issues because people don't understand it :(
#45
I still can't reproduce it but there is no harm in changing the suggested patch to:

if (isset($user_info['shd_permissions'][$perm]) && is_array($user_info['shd_permissions'][$perm]))
$user_info['shd_permissions'][$perm] = array_merge($user_info['shd_permissions'][$perm], $depts[$role]);
else
$user_info['shd_permissions'][$perm] = $depts[$role];


But it's been over two years since I wrote the code originally, I don't remember how most of it works any more. (Yes, I am SD's original developer.)