/[drupal]/contributions/modules/storm/stormticket/stormticket.module
ViewVC logotype

Diff of /contributions/modules/storm/stormticket/stormticket.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4, Mon Jun 23 16:46:36 2008 UTC revision 1.5, Tue Jul 1 07:47:43 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: stormticket.module,v 1.3 2008/06/18 15:25:32 robertogerola Exp $  // $Id: stormticket.module,v 1.4 2008/06/23 16:46:36 robertogerola Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 218  function stormticket_form(&$node) { Line 218  function stormticket_form(&$node) {
218      '#weight' => -20,      '#weight' => -20,
219    );    );
220    
221    $s = "SELECT n.nid, n.title FROM {stormorganization} sor INNER JOIN {node} n ON sor.nid=n.nid WHERE n.status=1 AND n.type='stormorganization' ORDER BY n.title";    $s = "SELECT n.nid, n.title FROM {node} AS n INNER JOIN {stormorganization} AS sor ON sor.vid=n.vid WHERE n.status=1 AND n.type='stormorganization' ORDER BY n.title";
222      $s = db_rewrite_sql($s);
223    $r = db_query(stormorganization_access_sql($s));    $r = db_query(stormorganization_access_sql($s));
224    $organizations = array();    $organizations = array();
225    while ($organization = db_fetch_object($r)) {    while ($organization = db_fetch_object($r)) {
# Line 234  function stormticket_form(&$node) { Line 235  function stormticket_form(&$node) {
235      '#attributes' => array('onchange' => "stormtask_organization_project_tasks(this, 'edit-project-nid', 'edit-parent-nid', true, '-')"),      '#attributes' => array('onchange' => "stormtask_organization_project_tasks(this, 'edit-project-nid', 'edit-parent-nid', true, '-')"),
236    );    );
237    
238    $s = "SELECT n.nid, n.title FROM {stormproject} spr INNER JOIN {node} n ON spr.nid=n.nid WHERE spr.organization_nid=%d AND n.status=1 AND n.type='stormproject' ORDER BY n.title";    $s = "SELECT n.nid, n.title FROM {node} AS n ON INNER JOIN {stormproject} AS spr spr.vid=n.vid WHERE spr.organization_nid=%d AND n.status=1 AND n.type='stormproject' ORDER BY n.title";
239      $s = db_rewrite_sql($s);
240    $r = db_query(stormproject_access_sql($s), $node->organization_nid);    $r = db_query(stormproject_access_sql($s), $node->organization_nid);
241    $projects = array();    $projects = array();
242    while ($project = db_fetch_object($r)) {    while ($project = db_fetch_object($r)) {
# Line 420  function stormticket_listblock($output=F Line 422  function stormticket_listblock($output=F
422    $rstatus_list = array_flip($status_list);    $rstatus_list = array_flip($status_list);
423    $ticketstatus = $rstatus_list['open'];    $ticketstatus = $rstatus_list['open'];
424    
425    $s  = "SELECT n.nid, n.title, n.uid, n.changed, sti.project_title, sti.project_nid, sti.task_title, sti.task_nid, sti.ticketcategory, sti.ticketstatus FROM {stormticket} sti INNER JOIN {node} n ON n.nid=sti.nid WHERE n.status=1 AND n.type='stormticket'";    $s  = "SELECT n.nid, n.title, n.uid, n.changed, sti.project_title, sti.project_nid, sti.task_title, sti.task_nid, sti.ticketcategory, sti.ticketstatus FROM
426      {node} AS n INNER JOIN {stormticket} AS sti ON n.vid=sti.vid WHERE n.status=1 AND n.type='stormticket'";
427    $v = str_replace(',', "','", $ticketstatus);    $v = str_replace(',', "','", $ticketstatus);
428    $where[] = "sti.ticketstatus IN ('". $v ."')";    $where[] = "sti.ticketstatus IN ('". $v ."')";
429      $s = db_rewrite_sql($s);
430    $r = pager_query(stormticket_access_sql($s, $where) .' ORDER BY n.changed', 10, 0, NULL);    $r = pager_query(stormticket_access_sql($s, $where) .' ORDER BY n.changed', 10, 0, NULL);
431    
432    $header = array(    $header = array(

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2