collapse collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 64
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM
  • phantomm: and from what I see only patch is broken, full install package is fine
    October 21, 2016, 03:44:44 PM

* Recent Posts

Re: v 2.3.3 to v2.3.7 by ♦ Ninja ZX-10RR ♦
[December 11, 2018, 04:14:48 PM]


v 2.3.3 to v2.3.7 by rollingrock
[December 11, 2018, 09:36:20 AM]


[Block] Help with editing few lines on Simpleportal by Wallen
[December 09, 2018, 05:10:34 AM]


Re: LinkTree by Chen Zhen
[November 15, 2018, 02:24:51 PM]


Re: blocks showing user avatars by hulapyk
[November 15, 2018, 01:47:11 PM]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: [Block] SimpleDesk  (Read 5982 times)

0 Members and 1 Guest are viewing this topic.

Online Kaede Akamatsu

  • Hero Member
  • *****
  • Posts: 2176
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
[Block] SimpleDesk
« on: November 03, 2015, 09:06:58 PM »
SimpleDesk Block

SMF 2.0
SimpleDesk 2.0 Anatidae



Code: [Select]
<?php

/**
 * @block SimpleDesk
 * @author Rhode Fey (Sayaka Maizono)
 * @version 1.0.0
 * @for SimpleDesk 2.0.0
*/

global $context$modSettings$txt$sourcedir;

$txt['shd_not_installed'] = 'Simple Desk is not currently installed!';

if (!
file_exists($sourcedir '/sd_source/SimpleDesk.php'))
{
echo '
<span class="smalltext" style="color: red;">
$txt['shd_not_installed']  . '
</span>'
;

return;
}

if (empty(
$modSettings['helpdesk_active']) || !empty($modSettings['shd_maintenance_mode']))
{
echo '
<span class="smalltext" style="color: red;">
$txt['shd_inactive'] . '
</span>'
;

return;
}

require_once(
$sourcedir '/sd_source/Subs-SimpleDesk.php');
require_once(
$sourcedir '/sd_source/SimpleDesk-SSI.php');

$is_staff false;
$staff_members shd_members_allowed_to('shd_staff');

if (
in_array($context['user']['id'], $staff_members))
$is_staff true;

if (
$is_staff)
show_tickets();
else
show_own_tickets();

function 
show_tickets()
{
global $context$scripturl$settings$txt;

$number_to_show 6;

$assigned_tickets ssi_staffAssignedTickets($context['user']['id'], $number_to_show'array');
$remaining_tickets ssi_getSDTickets('hdt.id_member_assigned != {int:assigned} AND hdt.status != {int:closed}', array('assigned' => $context['user']['id'], 'closed' => 6), $number_to_show'hdt.status ASC''array');

$tickets array_merge($assigned_tickets$remaining_tickets);
$tickets array_slice($tickets0$number_to_show);

ksort($tickets);
$ticket_count count($tickets);
$count 0;

if (empty($tickets))
{
echo '
<span class="smalltext" style="color: red;">
$txt['shd_error_no_tickets'] . '
</span>'
;

return;
}

echo '
<table class="sp_fullwidth">'
;

foreach ($tickets as $ticket)
{
if ($ticket['assigned']['id'] == $context['user']['id'])
{
$assigned true;
$icon '<img src="' $settings['default_images_url'] . '/simpledesk/assign.png" alt="Assigned to ' $context['user']['name'] . '" />';
}
else
{
$assigned false;
$icon '<img src="' $settings['default_images_url'] . '/simpledesk/unread.png" alt="Ticket" />';
}

echo '
<tr>
<td style="width: 24px; text-align: center;"><a href="' 
$ticket['href'] . '">' $icon '</a></td>
<td style="padding: 5px 0; vertical-align: bottom; '
$ticket_count != ++$count ' border-bottom: 1px dashed #AAA;' '''">';

echo '
<a href="' 
$scripturl '?action=helpdesk;sa=ticket;ticket=' $ticket['id'] . '">' $ticket['subject'] . '</a><br />';

echo '
<div style="padding-top: 3px; font-size: 9px">'
;

echo '
$txt['shd_ticket_status'] . ': ' $ticket['status_text'] . '<br />';

echo '
$txt['shd_ticket_urgency'] . ': ' $ticket['urgency_string'] . '<br />';

echo '
$txt['shd_ticket_started_by'] . ': ' $ticket['opener']['link'] . '<br />';

echo '
$ticket['start_time'] . '<br />';

echo '
</div>'
;

echo '
</td>
</tr>'
;
}

echo '
</table>'
;
}

function 
show_own_tickets()
{
global $context$scripturl$settings$txt;

$number_to_show 3;

$tickets ssi_userTickets($context['user']['id'], $number_to_show'array');

ksort($tickets);
$ticket_count count($tickets);
$count 0;

if (empty($tickets))
{
echo '
<span class="smalltext" style="color: red;">
$txt['shd_error_no_tickets'] . '
</span>'
;

return;
}

echo '
<table class="sp_fullwidth">'
;

foreach ($tickets as $ticket)
{
$icon '<img src="' $settings['default_images_url'] . '/simpledesk/unread.png" alt="Ticket" />';

echo '
<tr>
<td style="width: 24px; text-align: center;"><a href="' 
$ticket['href'] . '">' $icon '</a></td>
<td style="padding: 5px 0; vertical-align: bottom; '
$ticket_count != ++$count ' border-bottom: 1px dashed #AAA;' '''">';

echo '
<a href="' 
$scripturl '?action=helpdesk;sa=ticket;ticket=' $ticket['id'] . '">' $ticket['subject'] . '</a><br />';

echo '
<div style="padding-top: 3px; font-size: 9px">'
;

echo '
$txt['shd_ticket_status'] . ': ' $ticket['status_text'] . '<br />';

echo '
$ticket['start_time'] . '<br />';

echo '
</div>'
;

echo '
</td>
</tr>'
;
}

echo '
</table>'
;
}

?>

Known Issues
- Problems occur when in a multi-department setting. This problem seems to be present in the current version of SimpleDesk and needs to be fixed by their developers.

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1177
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: [Block] SimpleDesk
« Reply #1 on: November 03, 2015, 09:11:16 PM »
/Moved to Blocks and Modifications board.

Congrats, as it can clearly be seen in the screenshot I tested it and it works other than the "known issues" part. Very nice block!
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline GeneralMitch

  • Newbie
  • Posts: 3
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: [Block] SimpleDesk
« Reply #2 on: June 08, 2017, 11:56:27 AM »
Where do I download this mods I dont see a link

Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: [Block] SimpleDesk
« Reply #3 on: June 08, 2017, 08:11:58 PM »
There is no download. Just copy and paste the code in the top post.

Make a new block of type custom php.  Copy to code in and done.
For more information about block you can see the documentation - link at top.
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running