Permalink
Browse files

Merge branch '6.0.4' into stable

  • Loading branch information...
2 parents 048c115 + 6f6a3a3 commit 9b5cd520ed3367bdbb3affb7b2932706e422f8de @jstanden jstanden committed Aug 9, 2012
@@ -46,8 +46,8 @@
* - Jeff Standen, Darren Sugita, Dan Hildebrandt, Scott Luther
* WEBGROUP MEDIA LLC. - Developers of Cerberus Helpdesk
*/
-define("APP_BUILD", 2012080201);
-define("APP_VERSION", '6.0.3');
+define("APP_BUILD", 2012080901);
+define("APP_VERSION", '6.0.4');
define("APP_MAIL_PATH", APP_STORAGE_PATH . '/mail/');
View
@@ -528,10 +528,12 @@ static public function parseMime($mime, $full_filename) {
// See if we have a content filename
- $content_filename = isset($info['content-name']) ? $info['content-name'] : '';
+ $content_filename = isset($info['disposition-filename']) ? $info['disposition-filename'] : '';
if(empty($content_filename))
- $content_filename = isset($info['disposition-filename']) ? $info['disposition-filename'] : '';
+ $content_filename = isset($info['content-name']) ? $info['content-name'] : '';
+
+ $content_filename = self::fixQuotePrintableString($content_filename, $info['charset']);
// Content type
@@ -637,30 +639,16 @@ static public function parseMime($mime, $full_filename) {
break;
}
- if(!isset($info['content-name']) || empty($info['content-name'])) {
- if(isset($info['disposition-filename']))
- $info['content-name'] = $info['disposition-filename'];
- else
- $info['content-name'] = '';
- }
-
- // if un-named, call it "unnamed message part"
- if (empty($info['content-name'])) {
- $info['content-name'] = 'unnamed_message_part';
- }
-
- // filenames can be quoted-printable strings, too...
- $info['content-name'] = self::fixQuotePrintableString($info['content-name'], $info['charset']);
-
// content-name is not necessarily unique...
- if (isset($message->files[$info['content-name']])) {
+ if (isset($message->files[$content_filename])) {
$j=1;
- while (isset($message->files[$info['content-name'] . '(' . $j . ')'])) {
+ while (isset($message->files[$content_filename . '(' . $j . ')'])) {
$j++;
}
- $info['content-name'] = $info['content-name'] . '(' . $j . ')';
+ $content_filename = $content_filename . '(' . $j . ')';
}
- $message->files[$info['content-name']] = $attach;
+
+ $message->files[$content_filename] = $attach;
}
}
}
@@ -525,9 +525,9 @@ function getChooserView($view_id=null) {
$defaults->class_name = $this->getViewClass();
$view = C4_AbstractViewLoader::getView($view_id, $defaults);
$view->name = 'Buckets';
- $view->view_columns = array(
- SearchFields_Bucket::NAME,
- );
+ //$view->view_columns = array(
+ //SearchFields_Bucket::NAME,
+ //);
$view->addParams(array(
// SearchFields_Bucket::IS_DISABLED => new DevblocksSearchCriteria(SearchFields_Bucket::IS_DISABLED,'=',0),
), true);
@@ -23,7 +23,7 @@ class DAO_Task extends C4_ORMHelper {
const IS_COMPLETED = 'is_completed';
const COMPLETED_DATE = 'completed_date';
- static function create($fields) {
+ static function create($fields, $custom_fields=array()) {
$db = DevblocksPlatform::getDatabaseService();
$sql = sprintf("INSERT INTO task () ".
@@ -34,6 +34,10 @@ static function create($fields) {
self::update($id, $fields);
+ if(!empty($custom_fields)) {
+ DAO_CustomFieldValue::formatAndSetFieldValues(CerberusContexts::CONTEXT_TASK, $id, $custom_fields);
+ }
+
// New task
$eventMgr = DevblocksPlatform::getEventService();
$eventMgr->trigger(
@@ -42,6 +46,7 @@ static function create($fields) {
array(
'task_id' => $id,
'fields' => $fields,
+ 'custom_fields' => $custom_fields,
)
)
);
@@ -2722,18 +2722,20 @@ function profileGetUrl($context_id) {
}
function getMeta($context_id) {
- $url = $this->profileGetUrl($context_id);
- $friendly = null;
-
if(is_numeric($context_id)) {
$ticket = DAO_Ticket::get($context_id);
- $friendly = DevblocksPlatform::strToPermalink($ticket->mask);
} else {
$ticket = DAO_Ticket::getTicketByMask($context_id);
}
+
+ $friendly = DevblocksPlatform::strToPermalink($ticket->mask);
- if(!empty($friendly))
- $url .= ' - ' . $friendly;
+ if(!empty($friendly)) {
+ $url_writer = DevblocksPlatform::getUrlService();
+ $url = $url_writer->writeNoProxy('c=profiles&type=ticket&mask='.$ticket->mask, true);
+ } else {
+ $url = $this->profileGetUrl($context_id);
+ }
return array(
'id' => $ticket->id,
@@ -27,11 +27,17 @@ function render() {
$stack = $response->path;
@array_shift($stack); // profiles
@array_shift($stack); // ticket
- @$id = array_shift($stack);
+ @$id_string = array_shift($stack);
// Translate masks to IDs
- if(!is_numeric($id)) {
- $id = DAO_Ticket::getTicketIdByMask($id);
+ if(!is_numeric($id_string)) {
+ $id = DAO_Ticket::getTicketIdByMask($id_string);
+
+ if(empty($id))
+ $id = intval($id_string);
+
+ } else {
+ $id = intval($id_string);
}
if(null == ($ticket = DAO_Ticket::get($id))) {
@@ -67,13 +67,18 @@ function saveTaskPeekAction() {
// Comment
@$comment = DevblocksPlatform::importGPC($_REQUEST['comment'],'string','');
+
+ // Custom Fields
+ @$field_ids = DevblocksPlatform::importGPC($_POST['field_ids'], 'array', array());
// Save
if(!empty($id)) {
DAO_Task::update($id, $fields);
+ DAO_CustomFieldValue::handleFormPost(CerberusContexts::CONTEXT_TASK, $id, $field_ids);
} else {
- $id = DAO_Task::create($fields);
+ $custom_fields = DAO_CustomFieldValue::parseFormPost(CerberusContexts::CONTEXT_TASK, $field_ids);
+ $id = DAO_Task::create($fields, $custom_fields);
@$is_watcher = DevblocksPlatform::importGPC($_REQUEST['is_watcher'],'integer',0);
if($is_watcher)
@@ -87,10 +92,6 @@ function saveTaskPeekAction() {
}
}
- // Custom field saves
- @$field_ids = DevblocksPlatform::importGPC($_POST['field_ids'], 'array', array());
- DAO_CustomFieldValue::handleFormPost(CerberusContexts::CONTEXT_TASK, $id, $field_ids);
-
// Comments
if(!empty($comment) && !empty($id)) {
@$also_notify_worker_ids = DevblocksPlatform::importGPC($_REQUEST['notify_worker_ids'],'array',array());
@@ -15,14 +15,13 @@
<div id="divWorkspaceTab{$tab->id}"></div>
<script type="text/javascript">
- $workspace = $('#frmWorkspaceTab{$tab->id}');
// Lazy loading
$workspace = $('#divWorkspaceTab{$tab->id}');
$ajaxQueue = $({});
{foreach from=$list_ids item=list_id}
$ajaxQueue.queue(function(next) {
- $div = $('<div style="margin-bottom:10px;"></div>');
+ $div = $('<div style="margin-bottom:10px;" tab_id="{$tab->id}"></div>');
$div
.appendTo($workspace)
.html($('<div class="lazy" style="font-size:18pt;text-align:center;padding:50px;margin:20px;background-color:rgb(232,242,255);">Loading...</div>'))
@@ -39,6 +38,10 @@
$this,
'c=pages&a=initWorkspaceList&list_id={$list_id}',
function(html) {
+ if($this.attr('tab_id') != {$tab->id}) {
+ return;
+ }
+
$this
.html(html)
;
@@ -53,7 +56,11 @@
genericAjaxGet(
$div,
'c=pages&a=initWorkspaceList&list_id={$list_id}',
- function(html){
+ function(html) {
+ if($div.attr('tab_id') != {$tab->id}) {
+ return;
+ }
+
$div
.html(html)
;
@@ -1072,7 +1072,7 @@ function getMeta($context_id) {
$friendly = DevblocksPlatform::strToPermalink($opp->name);
if(!empty($friendly))
- $url .= ' - ' . $friendly;
+ $url .= '-' . $friendly;
return array(
'id' => $opp->id,
@@ -124,7 +124,7 @@ function showPeekPopupAction() {
if(!empty($id) && null == ($model = DAO_WebApiCredentials::get($id)))
return;
- if(!$active_worker->is_superuser && $active_worker->id != $model->worker_id)
+ if(!empty($id) && !$active_worker->is_superuser && $active_worker->id != $model->worker_id)
return;
if(!empty($model))
@@ -286,13 +286,11 @@ function postCreate() {
);
$this->_handleRequiredFields($reqfields, $fields);
+ // Custom fields
+ $custom_fields = $this->_handleCustomFields($_POST);
+
// Create
- if(false != ($id = DAO_Task::create($fields))) {
- // Handle custom fields
- $customfields = $this->_handleCustomFields($_POST);
- if(is_array($customfields))
- DAO_CustomFieldValue::formatAndSetFieldValues(CerberusContexts::CONTEXT_TASK, $id, $customfields, true, true, true);
-
+ if(false != ($id = DAO_Task::create($fields, $custom_fields))) {
$this->getId($id);
}
}

0 comments on commit 9b5cd52

Please sign in to comment.