Problem TableSort

Hello everybody, I'm trying to make my table ordered data.
I implemented the code below, but I don't understand what do I do with the query ....
For now, the header of the table is sortable by all fields ( the arrow appears to choose whether to order ASC or Disc), but I did not understand how to implement the query to do so.
here's the code:
<?php
function provaOrdinamento_menu(){
$items['ordina']= array(
'title'=> 'Prova Ordinamento',
'page callback'=> 'get_ticket',
'access callback'=>TRUE,
);
return $items;
};

function get_ticket(){
$output = drupal_get_form('provaOrdinamento_form');
return $output;
};

function provaOrdinamento_form($node, &$form_state, $filtro1=NULL, $filtro2=NULL){
$tickets = get_tickets();
$form['tickets']= array(
'#type'=>'value',
'#value'=> $tickets,
'#theme' => 'tabella_provaOrdinamento',
);
return $form;
};

function provaOrdinamento_theme(){
return array(
'tabella_provaOrdinamento' => array(
array('render element' => 'tickets')),
);
}

function get_tickets(){
$rows = array();
$result= "";
$query= db_select("rgls_ticket", "r");
$query->fields("r", array("id","titolo", "descrizione"));
$query->extend('TableSort');
$result = $query->execute();
foreach ($result as $node) {

Profile picture and field collections via API

Hello everybody.
Currently I'm developing an importing module that allows administrators to import content from a system that was used before.

After reading in into the drupal system and its well documentated code, I still don't get how to realize these two things:

Table wrapper

Dear colleagues,

I can't understand, how I can change the table wrapper symbols?
After execution following code

    $content = "";
    $query = db_select('usa2e_addressbook', 't');
    $query
        ->condition('uid', 1, '=')
        ->condition('deleted', 0, '=')
        ->fields('t')
        ->orderBy('isPrimary', 'ASC')
        ->orderBy('modified', 'DESC');
        ->execute();
        ->fetchAssoc();

I receive this SQL

Retrieve data of a node before updating content

I'm using a D7 system to let some users edit two content types, let's say type A and B: there's a report section that takes values from both content types and makes a calculation on them, the simplest being values from A minus values from B, storing the result, at each update without looping all nodes.

Let's say I have a field "a" in A and "b" in B and a stored initial value s=0. Values from A should be added, from B subtracted.

- create node A with a=7
- calculus: s=0, a=7 -> s = s+a = 0+7 = 7
- we have s=7
- create node B with b=5
- calculus: s=0, b=5 -> s = s-b = 7-5 = 2
- we have s=2
and so on...

if i update an already created node, I have the problem:
- update node B with b=5 -> b=4
- calculus: s=2, b_old=5, b_new=4 -> s = s+b_old-b_new = 2+5-4 = 3
- we have s=3

how can I retrieve b_old?

Actually I'm using field collections and multiple fields for "a" and "b" and rules to manage the update where I should be able to obtain old and new values, but there's a bug (#1286084: $node and $node_unchanged have the same values), so I can't find how to work it out, the only alternative being a loop at each update on all nodes (I want to avoid).

some failures

I installed a fresh Drupal 7 removed the empty 6 never used it.
Also plugged some modules recruit and more but this is the message i get when i move to the homepage.

Acces denied

You are not authorized to acces this page.

Probarly its something simple but i cant find it in the dashboard/admin section what it is.

Anyone suggestions?

How to split up the $links variable in Drupal 7?

I would like to split up the $links variable in Drupal 7 so I can print each element of the array individually.

How can I do this?

Thanks,

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x