Skip to content

Instantly share code, notes, and snippets.

@chrisns
Created October 26, 2012 10:44
Show Gist options
  • Save chrisns/3958134 to your computer and use it in GitHub Desktop.
Save chrisns/3958134 to your computer and use it in GitHub Desktop.
neuter maestro's og integration
diff --git maestro.admin.inc maestro.admin.inc
old mode 100644
new mode 100755
index 76cc821..14743d5
--- maestro.admin.inc
+++ maestro.admin.inc
@@ -750,7 +750,7 @@ function maestro_export($id) {
case MaestroAssignmentTypes::GROUP:
if ($assign_by == MaestroAssignmentBy::FIXED) {
- if (module_exists('og')) {
+ if (module_exists('ogDISABLED')) {
$query = db_select('og', 'a');
$query->addField('a', 'label');
$query->condition('a.gid', intval($ares->assign_id), '=');
diff --git maestro.moderator.inc maestro.moderator.inc
old mode 100644
new mode 100755
index bf61a7e..2488f73
--- maestro.moderator.inc
+++ maestro.moderator.inc
@@ -68,7 +68,7 @@ function maestro_outstanding_tasks($op='', $qid=0, $sec_token=NULL, $other=NULL)
$query->condition('a.rid', 2, '>');
$role_res = $query->execute();
- if (module_exists('og')) {
+ if (module_exists('ogDISABLED')) {
$query = db_select('og', 'a');
$query->addField('a', 'gid', 'aid');
$query->addField('a', 'label', 'name');
diff --git maestro.module maestro.module
old mode 100644
new mode 100755
index 2520e51..c6e6ff9
--- maestro.module
+++ maestro.module
@@ -901,7 +901,7 @@ function template_preprocess_maestro_taskconsole_details(&$variables) {
$otask->assignment_type = 'role';
break;
case MaestroAssignmentTypes::GROUP:
- if (module_exists('og')) {
+ if (module_exists('ogDISABLED')) {
// Test if group name has been set to use a variable for this task
if ($record->assign_id == 0 AND $record->process_variable > 0) {
$maestro = Maestro::createMaestroObject(1); // Initiate the processing of all tasks of type 1.x
diff --git maestro.views.inc maestro.views.inc
old mode 100644
new mode 100755
index acbb609..768a9a1
--- maestro.views.inc
+++ maestro.views.inc
@@ -728,7 +728,7 @@ class maestro_handler_filter_assigned_user extends views_handler_filter {
}
/* Add filter condition for groups if enabled and user is any groups */
- if (module_exists('og')) {
+ if (module_exists('ogDISABLED')) {
$query = db_select('field_data_group_audience', 'a');
$query->addField('a','group_audience_gid', 'gid');
$query->condition('a.entity_type','user','=');
diff --git maestro_constants.class.php maestro_constants.class.php
old mode 100644
new mode 100755
index df7711c..2404385
--- maestro_constants.class.php
+++ maestro_constants.class.php
@@ -127,7 +127,7 @@ class MaestroAssignmentTypes {
$labels = array();
$labels[self::USER] = array('name' => 'USER', 'label' => t('User'));
$labels[self::ROLE] = array('name' => 'ROLE', 'label' => t('Role'));
- if(module_exists('og')) {
+ if(module_exists('ogDISABLED')) {
$labels[self::GROUP] = array('name' => 'GROUP', 'label' => t('Group'));
} else {
$labels[self::GROUP] = FALSE;
diff --git maestro_engine_version1.class.php maestro_engine_version1.class.php
old mode 100644
new mode 100755
index c36f967..32a2365
--- maestro_engine_version1.class.php
+++ maestro_engine_version1.class.php
@@ -1039,7 +1039,7 @@ class MaestroEngineVersion1 extends MaestroEngine {
$queries[MaestroAssignmentTypes::ROLE] = $query;
- if (module_exists('og')) {
+ if (module_exists('ogDISABLED')) {
//query gets all og's assigned to this task, up to the logic to determine whether or not they are assigned
$query = db_select('maestro_queue', 'a');
$query->join('maestro_template_data', 'b', 'a.template_data_id = b.id');
diff --git maestro_task_interface.class.php maestro_task_interface.class.php
old mode 100644
new mode 100755
index 99a63b8..bace68c
--- maestro_task_interface.class.php
+++ maestro_task_interface.class.php
@@ -182,7 +182,7 @@ abstract class MaestroTaskInterface {
}
}
- if(module_exists('og')) {
+ if(module_exists('ogDISABLED')) {
$res = og_get_group_ids();
foreach ($res as $rec) {
$og = og_load($rec);
@@ -505,7 +505,7 @@ abstract class MaestroTaskInterface {
$query->leftJoin('maestro_template_variables', 'b', 'a.assign_id=b.id');
$query->leftJoin('users', 'c', 'a.assign_id=c.uid');
$query->leftJoin('role', 'd', 'a.assign_id=d.rid');
- if (module_exists('og')) {
+ if (module_exists('ogDISABLED')) {
$query->leftJoin('og', 'e', 'a.assign_id=e.gid');
$query->addField('e', 'label', 'groupname');
}
@@ -611,7 +611,7 @@ abstract class MaestroTaskInterface {
* During the import routine, we take the exported OG and try to find the gid (group id).
*/
function modulateExportOG($group) {
- if(module_exists('og')) {
+ if(module_exists('ogDISABLED')) {
$query = db_select('og', 'a');
$query->fields('a',array('gid'));
$query->condition('a.label', $group, '=');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment