Newer
Older
* which should, via an AJAX callback, trigger this action to be
* performed. The URL for this sort of activity is already provided for
* you via the ::getAjaxUrl() method in this class.
*/
abstract function getJsStub();
/**
* getAjaxUrl
*
* Generate a URL to be used as an AJAX callback. The URL can be used to
* trigger this thread entry action via the callback.
*
* Parameters:
* $dialog - (bool) used in conjunction with `$.dialog()` javascript
* function which assumes the `ajax.php/` should be replace a leading
* `#` in the url
*/
function getAjaxUrl($dialog=false) {
$this->entry->getThread()->getObjectType() == 'T' ? 'tickets' : 'tasks',
$this->entry->getThread()->getObjectId(),
$this->entry->getId(),
function getTicketsAPI() {
return new TicketsAjaxAPI();
}
function getTasksAPI() {
return new TasksAjaxAPI();
}
function getThreadId();
function getThread();
function postThreadEntry($type, $vars, $options=array());
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
/**
* ThreadActivity
*
* Object to thread activity
*
*/
class ThreadActivity implements TemplateVariable {
var $title;
var $desc;
function __construct($title, $desc) {
$this->title = $title;
$this->desc = $desc;
}
function getTitle() {
return $this->title;
}
function getDescription() {
return $this->desc;
}
function asVar() {
return (string) $this->getTitle();
}
function getVar($tag) {
if ($tag && is_callable(array($this, 'get'.ucfirst($tag))))
return call_user_func(array($this, 'get'.ucfirst($tag)));
return false;
}
static function getVarScope() {
return array(
'title' => __('Activity Title'),
'description' => __('Activity Description'),
);
}
}