Permalink
Browse files

Merge branch '6.0.5' into stable

  • Loading branch information...
2 parents 9b5cd52 + 3fe57e9 commit acdb0a20d7642ad62ba3b7a593d36c4106e4cbcd @jstanden jstanden committed Aug 20, 2012
Showing with 271 additions and 136 deletions.
  1. +2 −2 api/Application.class.php
  2. +11 −5 features/cerberusweb.core/api/dao/address.php
  3. +11 −5 features/cerberusweb.core/api/dao/calendar_event.php
  4. +11 −5 features/cerberusweb.core/api/dao/contact_org.php
  5. +11 −5 features/cerberusweb.core/api/dao/contact_person.php
  6. +11 −5 features/cerberusweb.core/api/dao/context_scheduled_behavior.php
  7. +11 −5 features/cerberusweb.core/api/dao/group.php
  8. +7 −0 features/cerberusweb.core/api/dao/mail_to_group_rule.php
  9. +11 −5 features/cerberusweb.core/api/dao/snippet.php
  10. +11 −5 features/cerberusweb.core/api/dao/task.php
  11. +11 −5 features/cerberusweb.core/api/dao/ticket.php
  12. +12 −7 features/cerberusweb.core/api/dao/worker.php
  13. +12 −5 features/cerberusweb.core/api/dao/workspace.php
  14. +5 −3 features/cerberusweb.core/api/uri/config/plugin_library.php
  15. +2 −2 features/cerberusweb.core/api/uri/internal.php
  16. +3 −0 features/cerberusweb.core/api/uri/search.php
  17. +6 −4 features/cerberusweb.core/plugin.xml
  18. +14 −10 features/cerberusweb.core/templates/configuration/section/groups/edit_group.tpl
  19. +8 −3 features/cerberusweb.core/templates/events/action_schedule_behavior.tpl
  20. +1 −1 features/cerberusweb.core/templates/menu.tpl
  21. +11 −5 features/cerberusweb.crm/api/dao/crm_opportunity.php
  22. +0 −4 features/cerberusweb.kb/api/App.php
  23. +11 −10 features/cerberusweb.kb/api/dao/kb_article.php
  24. +5 −6 features/cerberusweb.kb/templates/kb/peek_edit.tpl
  25. +1 −1 features/cerberusweb.kb/templates/kb/peek_readonly.tpl
  26. +1 −1 features/cerberusweb.kb/templates/kb/profile.tpl
  27. +13 −5 features/cerberusweb.restapi/api/dao/webapi_credentials.php
  28. +20 −7 features/cerberusweb.timetracking/api/dao/timetracking_entry.php
  29. +2 −2 features/cerberusweb.timetracking/templates/timetracking/peek.tpl
  30. +1 −1 features/cerberusweb.timetracking/templates/timetracking/renderers/prebody.tpl
  31. +13 −5 install/extras/sdk/devblocks-dao.php
  32. +21 −6 libs/devblocks/api/services/date.php
  33. +1 −1 libs/devblocks/api/services/template.php
@@ -46,8 +46,8 @@
* - Jeff Standen, Darren Sugita, Dan Hildebrandt, Scott Luther
* WEBGROUP MEDIA LLC. - Developers of Cerberus Helpdesk
*/
-define("APP_BUILD", 2012080901);
-define("APP_VERSION", '6.0.4');
+define("APP_BUILD", 2012082001);
+define("APP_VERSION", '6.0.5');
define("APP_MAIL_PATH", APP_STORAGE_PATH . '/mail/');
@@ -360,16 +360,22 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
// Translate virtual fields
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_Address', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
$result = array(
'primary_table' => 'a',
'select' => $select_sql,
@@ -185,16 +185,22 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
$sort_sql = (!empty($sortBy)) ? sprintf("ORDER BY %s %s ",$sortBy,($sortAsc || is_null($sortAsc))?"ASC":"DESC") : " ";
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_CalendarEvent', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
return array(
'primary_table' => 'calendar_event',
'select' => $select_sql,
@@ -356,16 +356,22 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
// Translate virtual fields
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_ContactOrg', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
$result = array(
'primary_table' => 'c',
'select' => $select_sql,
@@ -215,16 +215,22 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
// Translate virtual fields
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_ContactPerson', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
return array(
'primary_table' => 'contact_person',
'select' => $select_sql,
@@ -279,16 +279,22 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
// Translate virtual fields
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_ContextScheduledBehavior', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
return array(
'primary_table' => 'context_scheduled_behavior',
'select' => $select_sql,
@@ -389,16 +389,22 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
$sort_sql = (!empty($sortBy)) ? sprintf("ORDER BY %s %s ",$sortBy,($sortAsc || is_null($sortAsc))?"ASC":"DESC") : " ";
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_Group', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
$result = array(
'primary_table' => 'g',
'select' => $select_sql,
@@ -218,10 +218,17 @@ static function getMatches(Model_Address $fromAddress, CerberusParserMessage $me
if(is_array($to_list))
foreach($to_list as $addy) {
+ if(!isset($addy->mailbox) || !isset($addy->host))
+ continue;
+
$tocc[] = $addy->mailbox . '@' . $addy->host;
}
+
if(is_array($cc_list))
foreach($cc_list as $addy) {
+ if(!isset($addy->mailbox) || !isset($addy->host))
+ continue;
+
$tocc[] = $addy->mailbox . '@' . $addy->host;
}
@@ -223,17 +223,23 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
$sort_sql = (!empty($sortBy)) ? sprintf("ORDER BY %s %s ",$sortBy,($sortAsc || is_null($sortAsc))?"ASC":"DESC") : " ";
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values,
+ );
+
// Virtuals
array_walk_recursive(
$params,
array('DAO_Snippet', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
$result = array(
'primary_table' => 'snippet',
'select' => $select_sql,
@@ -308,16 +308,22 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
// Translate virtual fields
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_Task', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
$result = array(
'primary_table' => 't',
'select' => $select_sql,
@@ -1202,15 +1202,21 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
// Translate virtual fields
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_Ticket', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
// Fulltext has multiple values
if(isset($tables['ftmc']))
@@ -407,8 +407,7 @@ static function logActivity(Model_Activity $activity, $ignore_wait=false) {
public static function random() {
$db = DevblocksPlatform::getDatabaseService();
- $offset = $db->GetOne(sprintf("SELECT ROUND(RAND()*(SELECT COUNT(*)-1 FROM worker WHERE is_disabled=0))"));
- return $db->GetOne(sprintf("SELECT id FROM worker LIMIT %d,1",$offset));
+ return $db->GetOne("SELECT id FROM worker WHERE is_disabled=0 ORDER BY rand() LIMIT 1");
}
public static function getSearchQueryComponents($columns, $params, $sortBy=null, $sortAsc=null) {
@@ -459,16 +458,22 @@ public static function getSearchQueryComponents($columns, $params, $sortBy=null,
$sort_sql = (!empty($sortBy)) ? sprintf("ORDER BY %s %s ",$sortBy,($sortAsc || is_null($sortAsc))?"ASC":"DESC") : " ";
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_Worker', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
$result = array(
'primary_table' => 'w',
'select' => $select_sql,
@@ -267,16 +267,23 @@ static function search($columns, $params, $limit=10, $page=0, $sortBy=null, $sor
$sort_sql = $query_parts['sort'];
// Virtuals
+
+ $args = array(
+ 'join_sql' => $join_sql,
+ 'where_sql' => $where_sql,
+ 'has_multiple_values' => $has_multiple_values
+ );
+
array_walk_recursive(
$params,
array('DAO_WorkspacePage', '_translateVirtualParameters'),
- array(
- 'join_sql' => &$join_sql,
- 'where_sql' => &$where_sql,
- 'has_multiple_values' => &$has_multiple_values
- )
+ &$args
);
+ $join_sql = $args['join_sql'];
+ $where_sql = $args['where_sql'];
+ $has_multiple_values = $args['has_multiple_values'];
+
$sql =
$select_sql.
$join_sql.
@@ -178,9 +178,11 @@ function saveDownloadPopupAction() {
DevblocksPlatform::clearCache();
// Reload plugin translations
- $strings_xml = APP_PATH . '/' . $plugin->dir . '/strings.xml';
- if(file_exists($strings_xml)) {
- DAO_Translation::importTmxFile($strings_xml);
+ if(null != ($plugin_manifest = DevblocksPlatform::getPlugin($plugin->id))) {
+ $strings_xml = APP_PATH . '/' . $plugin_manifest->dir . '/strings.xml';
+ if(file_exists($strings_xml)) {
+ DAO_Translation::importTmxFile($strings_xml);
+ }
}
echo json_encode(array(
@@ -2748,8 +2748,8 @@ function showScheduleBehaviorParamsAction() {
$tpl->assign('namePrefix', $name_prefix);
- $trigger = DAO_TriggerEvent::get($trigger_id);
- $tpl->assign('macro_params', $trigger->variables);
+ if(null != ($trigger = DAO_TriggerEvent::get($trigger_id)))
+ $tpl->assign('macro_params', $trigger->variables);
$tpl->display('devblocks:cerberusweb.core::events/action_schedule_behavior_params.tpl');
}
@@ -52,6 +52,9 @@ function render() {
return;
}
+ if(!isset($context_ext->manifest->params['options'][0]['workspace']))
+ return;
+
$tpl->assign('context_ext', $context_ext);
$view = $context_ext->getSearchView();
Oops, something went wrong.

0 comments on commit acdb0a2

Please sign in to comment.