Skip to content

Commit

Permalink
- Make hubs field in dootrips a hyperlink to the hub page: https://ww…
Browse files Browse the repository at this point in the history
…w.labdoo.org/content/hubs-dootrips-not-link

- Fix do not show the revision icon if there are no revisions.
- Fixed alphabetic order of languages in email templates
- Fixed added dootrip title in email templates
- Improved visualization dashboards
- Improved translation templates
  • Loading branch information
jrosgiralt committed Jul 5, 2017
1 parent f402c3c commit 0b0663b
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 29 deletions.
2 changes: 2 additions & 0 deletions docs/labdoo-queries.org
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The following are some of the most commonly used SQL queries.
mysql> SELECT DISTINCT country FROM location WHERE lid IN (SELECT lid FROM location_instance WHERE nid!=0 ORDER by nid);
#+END_EXAMPLE

- Note: you can also use the php function labdoo_list_all_countries() to print all countries and cities.

- To get the same list for cities instead of countries:

#+BEGIN_EXAMPLE
Expand Down
5 changes: 3 additions & 2 deletions modules/custom/labdoo_lib/labdoo_lib.module
Original file line number Diff line number Diff line change
Expand Up @@ -4218,8 +4218,9 @@ function labdoo_render_object_menu() {
t("Edit this $objectString") . "</a></p> ";

// Revisions
$code .= "<p><a href='node/$nodeId/revisions'><img src='/profiles/labdoo/files/pictures/revisions-icon.png' width='25px'/>&nbsp;" .
t("Review changes") . "</a></p> ";
if(count(node_revision_list($nodeObj)) > 1)
$code .= "<p><a href='node/$nodeId/revisions'><img src='/profiles/labdoo/files/pictures/revisions-icon.png' width='25px'/>&nbsp;" .
t("Review changes") . "</a></p> ";

// Clone
if(in_array('superhub manager', $userRoles) || in_array('administrator', $userRoles))
Expand Down
5 changes: 3 additions & 2 deletions modules/custom/lbd_communicate/lbd_communicate.module
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ function lbd_communicate_cron() {
$subject = preg_replace('/^[0-9]+ /', '', trim($subject));
$subject = preg_replace('/^- /', '', trim($subject));

$params["DOOTRIP_TITLE"] = $dootripTitle;
$params["DOOTRIP_URL"] = url(drupal_get_path_alias('node/' . $dootripNid), array('absolute' => TRUE));
$params["DOOTRIP_URL"] = labdoo_lib_convert_html_link($params["DOOTRIP_URL"]);
$params["CONTACT_EMAIL"] = variable_get('site_mail', '');
Expand Down Expand Up @@ -1290,12 +1291,12 @@ function _body_do_parameters($params, &$body) {
// language is added to the list of supported languages
// in labdoo/translations/email-files
$supportedLanguages = array("ca" => "Catalan",
"zh-hant" => "Chinese",
"de" => "Deutsch",
"en" => "English",
"es" => "Spanish",
"fr" => "French",
"nl" => "Nederlands",
"zh-hant" => "Chinese");
"es" => "Spanish");

$urlParameters = "?" . drupal_http_build_query($params);

Expand Down
35 changes: 16 additions & 19 deletions modules/custom/lbd_visualize/lbd_visualize.module
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ function lbd_display_dashboard_doojects($userId = NULL, $hubId = NULL, $edoovill
$hubsList = labdoo_lib_get_field_all($node, 'field_hub_laptop', 'node', 'target_id');
$hubsListStr = "";
foreach($hubsList as $hubNodeId) {
$hubsListStr .= "<a href='../node/$hubNodeId' target='_blank'>" . lbd_nodeid2title($hubNodeId) . "</a> | ";
$hubsListStr .= lbd_nodeid2title($hubNodeId) . " | ";
}
$objects[$objectNid]['hub'] = substr($hubsListStr, 0, -3);

// Extract Edoovillage Field
$edoovillageNodeId = labdoo_lib_get_field($node, 'field_edoovillage_destination', 'node', 'target_id');
if(!empty($node->field_edoovillage_destination))
$objects[$objectNid]['edoovillage'] = "<a href='../node/$edoovillageNodeId' target='_blank'>" . lbd_nodeid2title($edoovillageNodeId) . "</a>";
$objects[$objectNid]['edoovillage'] = lbd_nodeid2title($edoovillageNodeId);
else
$objects[$objectNid]['edoovillage'] = "Not assigned";
$objects[$objectNid]['edoovillage'] = "";

// Extract Status Field
$objects[$objectNid]['status'] = $objectstatus = labdoo_lib_get_field($node, 'field_status', 'node', 'value');
Expand Down Expand Up @@ -231,17 +231,15 @@ function lbd_display_dashboard_doojects($userId = NULL, $hubId = NULL, $edoovill

// Dootrips field
$dootripsFieldList = field_get_items('node', $node, 'field_dootrips');
$dootripsStrList = "";
$objects[$objectNid]['dootripId'] = "";
if(!empty($dootripsFieldList)) {
$dootripsStrList = "";
foreach($dootripsFieldList as $key => $dootripNode) {
$dstLoaded = node_load($dootripNode['target_id']);
if($dootripsStrList == "")
$dootripsStrList = "#" . lbd_extract_dootrip_id($dstLoaded->title);
else
$dootripsStrList = $dootripsStrList . ", " . "#" . lbd_extract_dootrip_id($dstLoaded->title);
$dootripNodeId = $dootripNode['target_id'];
$dootripsStrList .= "#" . lbd_extract_dootrip_id(lbd_nodeid2title($dootripNodeId)) . " ";
}
$objects[$objectNid]['dootripId'] = substr($dootripsStrList, 0, -1);
}
$objects[$objectNid]['dootripId'] = $dootripsStrList;

// Extract Model Field
$objects[$objectNid]['model'] = labdoo_lib_get_field($node, 'field_model', 'node', 'value');
Expand Down Expand Up @@ -418,8 +416,12 @@ function lbd_display_dashboard_edoovillages($userId = NULL, $hubId = NULL, $coun

// Extract hubs
$objects[$objectNid]['hub'] = "";
foreach(field_get_items('node', $node, 'field_hub') as $item)
$objects[$objectNid]['hub'] = $objects[$objectNid]['hub'] . " " . lbd_nodeid2title($item['target_id']);
$hubsListStr = "";
foreach(field_get_items('node', $node, 'field_hub') as $item) {
$hubNodeId = $item['target_id'];
$hubsListStr .= lbd_nodeid2title($hubNodeId) . " | ";
}
$objects[$objectNid]['hub'] = substr($hubsListStr, 0, -3);

// Extract needed field
$objects[$objectNid]['needed'] = $needed = labdoo_lib_get_field($node, 'field_number_of_laptops_needed', 'node', 'value');
Expand Down Expand Up @@ -1119,12 +1121,6 @@ var stringFilter = new google.visualization.ControlWrapper({
});
");

// For the dootrips dashboard, present in descending alphabetic order.
if($objectsType == 'dootrip')
$sortAscValue = 'false';
else
$sortAscValue = 'true';

print("

/*
Expand All @@ -1140,7 +1136,8 @@ var table = new google.visualization.ChartWrapper({
'page': 'enable',
'pageSize' : 50,
'sortColumn' : 0,
'sortAscending' : " . $sortAscValue . "
'sortAscending' : false,
'sort' : 'enable'
},
view: {columns: [0, 1, 2, 3, 4]}
});
Expand Down
60 changes: 56 additions & 4 deletions modules/features/labdoo_objects/labdoo_objects.features.field.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ $display_output = $entity_field_item[\'value\'];',
$fields['node-dootrip-field_dootrip_hub'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'cardinality' => '-1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_dootrip_hub',
Expand Down Expand Up @@ -1131,10 +1131,10 @@ $display_output = $entity_field_item[\'value\'];',
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'label' => 'inline',
'module' => 'entityreference',
'settings' => array(
'link' => FALSE,
'link' => 1,
),
'type' => 'entityreference_label',
'weight' => '5',
Expand Down Expand Up @@ -2635,7 +2635,7 @@ $display_output = $entity_field_item[\'value\'];',
$fields['node-edoovillage-field_edoo_additional_followers'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'cardinality' => '-1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_edoo_additional_followers',
Expand Down Expand Up @@ -2708,6 +2708,58 @@ $display_output = $entity_field_item[\'value\'];',
'status' => 0,
),
),
'nodeaccess_userreference' => array(
'all' => array(
'view' => 0,
),
'all_published' => '0',
'author' => array(
'delete' => 0,
'update' => 0,
'view' => 0,
),
'author_published' => '0',
'create' => array(
'action' => 0,
'article' => 0,
'blog' => 0,
'book' => 0,
'dootrip' => 0,
'drupal_wall' => 0,
'edoovillage' => 0,
'event' => 0,
'gic' => 0,
'hub' => 0,
'labdoo_slide' => 0,
'labdoo_story' => 0,
'laptop' => 0,
'node_gallery_gallery' => 0,
'node_gallery_item' => 0,
'page' => 0,
'private_page' => 0,
'simplenews' => 0,
'slider_page' => 0,
'superhub_page' => 0,
'team' => 0,
'team_page' => 0,
'team_task' => 0,
),
'priority' => '0',
'referenced' => array(
'delete' => 0,
'deny_delete' => 0,
'deny_update' => 0,
'deny_view' => 0,
'update' => 0,
'view' => 0,
),
'referenced_published' => '0',
'unused' => '0',
'views' => array(
'view' => '',
'view_args' => '',
),
),
'user_register_form' => FALSE,
),
'widget' => array(
Expand Down
2 changes: 1 addition & 1 deletion modules/features/labdoo_objects/labdoo_objects.info
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,4 @@ features[variable][] = pathauto_node_dootrip_pattern
features[variable][] = pathauto_node_edoovillage_pattern
features[variable][] = pathauto_node_hub_pattern
features[variable][] = pathauto_node_laptop_pattern
mtime = 1496774109
mtime = 1496774158
2 changes: 1 addition & 1 deletion translations/email-files/ca/laptop_delivered_body-ca.email
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Si us plau, comprova que el teu dispositiu s’està utilitzant clicant a l’en

També pots trobar imatges clicant a la icona de l’àlbum de fotos de la pàgina de l’edoovillage: [EDOOVILLAGE_URL]

Junts, amb actes com el teu, podem salvar l’escletxa digital. En nom de tota la gent com tu que forma part del projecte Labdoo, gràcies per fer aquesta contribució tant important.
Junts, amb actes com el teu, podem fer arribar l'educació a tots els pobles del món. En nom de tota la gent com tu que forma part del projecte Labdoo, gràcies per fer aquesta contribució tant important.

Si us plau, fixa’t que seguint el cicle de vida de la tecnologia, aquesta no és la destinació final del dispositiu. Un cop deixi de funcionar, hauria de ser una planta de reciclatge, tornant al planeta Terra i tancant el cercle de la vida. Per tant, si detectes que aquest dispositiu ha deixat de funcionar i necessita ser reciclat, si us plau, actualitza el seu estat. Això ajudarà automàticament a activar un nou dootrip per rescatar-lo i ajudar a reciclar-lo.

Expand Down

0 comments on commit 0b0663b

Please sign in to comment.