Skip to content

Commit 398bad0

Browse files
committed
added: option to auto close supoprt tickets
changed: layout of a support ticket fixed: unable to display contextual help on front page
1 parent a81055d commit 398bad0

File tree

9 files changed

+42
-5
lines changed

9 files changed

+42
-5
lines changed

_graphics/button_bg.png

-836 Bytes
Loading

actions/ticket/edit.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
}
3434

3535
if(!empty($ticket)){
36-
$ticket->title = $title;
36+
$ticket->title = elgg_get_excerpt($title, 50);
37+
$ticket->description = $title;
3738

3839
$ticket->help_url = $help_url;
3940
$ticket->help_context = $help_context;

classes/UserSupportTicket.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ protected function initialise_attributes() {
1818
public function getURL(){
1919
global $CONFIG;
2020

21-
return $CONFIG->wwwroot . "pg/user_support/support_ticket/" . $this->getGUID() . "/" . elgg_get_friendly_title($this->title);
21+
$title = $this->title;
22+
if(strlen($title) > 50){
23+
$title = elgg_get_excerpt($title, 50);
24+
}
25+
$title = str_replace("...", "", $title);
26+
27+
return $CONFIG->wwwroot . "pg/user_support/support_ticket/" . $this->getGUID() . "/" . elgg_get_friendly_title($title);
2228
}
2329

2430
public function getStatus(){

languages/en.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
// settings
2828
'user_support:settings:help_group' => "Select a group for users to ask for help",
2929
'user_support:settings:help_group:non' => "No support group",
30+
31+
'user_support:settings:auto_close_tickets' => "Auto close support tickets on an answer from an admin?",
3032

3133
// annotations
3234
'support_ticket:river:annotate' => "a comment on",

lib/events.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ function user_support_create_annotation_event($event, $type, $annotation){
99
if(!empty($entity) && ($entity instanceof UserSupportTicket) && !empty($user)){
1010
if($user->getGUID() != $entity->getOwner()){
1111
// user is not owner and is admin, so close ticket
12-
$entity->setStatus(UserSupportTicket::CLOSED);
12+
if(get_plugin_Setting("auto_close_tickets", "user_support") == "yes"){
13+
$entity->setStatus(UserSupportTicket::CLOSED);
14+
}
1315
} elseif($user->getGUID() == $entity->getOwner()){
1416
// user is the owner, so reopen
1517
$entity->setStatus(UserSupportTicket::OPEN);

manifest.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<plugin_manifest>
33
<field key="author" value="ColdTrick IT Solutions" />
4-
<field key="version" value="1.1" />
4+
<field key="version" value="1.2" />
55
<field key="description" value="Offers user support" />
66
<field key="website" value="http://www.coldtrick.com/" />
77
<field key="copyright" value="(C) ColdTrick IT Solutions 2011" />
@@ -23,6 +23,11 @@ ToDo
2323
=========================
2424
Version Information
2525
=========================
26+
1.2 (2011-05-27):
27+
- added: option to auto close supoprt tickets
28+
- changed: layout of a support ticket
29+
- fixed: unable to display contextual help on front page
30+
2631
1.1 (2011-05-20):
2732
- added: option to select a support group
2833
- added: search in Help Center now searches in contextual help

pages/help_center.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
$help_url = $_SERVER["HTTP_REFERER"];
66
$help_context = user_support_get_help_context($help_url);
7+
if(empty($help_context)){
8+
$help_context = user_support_get_help_context();
9+
}
710
$contextual_help_object = user_support_get_help_for_context($help_context);
811

912
if(is_plugin_enabled("groups")){

views/default/object/support_ticket.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
if(!empty($entity->support_type)){
3737
$info .= elgg_echo("user_support:support_type:" . $entity->support_type) . ": ";
3838
}
39-
$info .= elgg_view("output/url", array("href" => $entity->getURL(), "text" => $entity->title));
39+
$title = $entity->title;
40+
if(strlen($title) > 50){
41+
$title = elgg_get_exerpt($title, 50);
42+
}
43+
$info .= elgg_view("output/url", array("href" => $entity->getURL(), "text" => $title));
4044

4145
$info .= "<div class='clearfloat'></div>";
4246

@@ -102,6 +106,12 @@
102106
echo elgg_echo("user_support:url") . ": " . elgg_view("output/url", array("href" => $entity->help_url)) . "<br />";
103107
}
104108

109+
if(!empty($entity->description)){
110+
echo elgg_view("output/longtext", array("value" => $entity->description));
111+
} elseif(strlen($entity->title) > 50) {
112+
echo elgg_view("output/longtext", array("value" => $entity->title));
113+
}
114+
105115
?>
106116
<div class="clearfloat"></div>
107117

views/default/settings/user_support/edit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?php
22

33
$plugin = $vars["entity"];
4+
5+
$noyes_options = array(
6+
"no" => elgg_echo("option:no"),
7+
"yes" => elgg_echo("option:yes")
8+
);
49

510
if(is_plugin_enabled("groups")){
611
$group_options = array(
@@ -23,5 +28,8 @@
2328
echo "<div>" . elgg_echo("user_support:settings:help_group") . "</div>";
2429
echo elgg_view("input/pulldown", array("internalname" => "params[help_group_guid]", "options_values" => $group_options_value, "value" => (int) $plugin->help_group_guid));
2530
}
31+
32+
echo "<div>" . elgg_echo("user_support:settings:auto_close_tickets") . "</div>";
33+
echo elgg_view("input/pulldown", array("internalname" => "params[auto_close_tickets]", "options_values" => $noyes_options, "value" => (int) $plugin->auto_close_tickets));
2634

2735
?>

0 commit comments

Comments
 (0)