Merge with master

This commit is contained in:
Romain Neutron
2012-01-04 10:47:01 +01:00
10 changed files with 71 additions and 34 deletions

View File

@@ -28,7 +28,7 @@ class module_report_download extends module_report
'usrid' => 'log.usrid',
'coll_id' => 'record.coll_id',
'xml' => 'record.xml',
'ddate' => "log.date",
'ddate' => "log_docs.date",
'id' => 'log_docs.id',
'log_id' => 'log_docs.log_id',
'record_id' => 'log_docs.record_id',
@@ -39,6 +39,7 @@ class module_report_download extends module_report
'file' => 'subdef.file'
);
protected $isInformative;
/**
* constructor
*
@@ -277,5 +278,16 @@ class module_report_download extends module_report
return $array;
}
public function IsInformative()
{
return $this->isInformative;
}
public function setIsInformative($isInformative)
{
$this->isInformative = $isInformative;
}
}

View File

@@ -18,16 +18,22 @@
class module_report_sqldownload extends module_report_sql implements module_report_sqlReportInterface
{
protected $restrict = false;
public function __construct(module_report $report)
{
parent::__construct($report);
if($report->isInformative())
{
$this->restrict = true;
}
}
public function buildSql()
{
$registry = registry::get_instance();
$report_filters = $this->filter->getReportFilter();
$record_filters = $this->filter->getRecordFilter() ?: array('sql'=>'', 'params'=> array());
$record_filters = $this->filter->getRecordFilter() ? : array('sql' => '', 'params' => array());
$this->params = array_merge($report_filters['params'], $record_filters['params']);
if ($this->groupby == false)
@@ -58,17 +64,19 @@ class module_report_sqldownload extends module_report_sql implements module_repo
$this->sql .= $report_filters['sql'] ? : '';
$this->sql .= ' AND ( log_docs.action = \'download\' OR log_docs.action = \'mail\')';
if($this->restrict)
$this->sql .= ' AND ( log_docs.final = "document" OR log_docs.final = "preview")';
$this->sql .= empty($record_filters['sql']) ? '' : ' AND ( ' . $record_filters['sql'] . ' )';
$this->sql .= $this->filter->getOrderFilter() ?: '';
$this->sql .= $this->filter->getOrderFilter() ? : '';
// var_dump(str_replace(array_keys($this->params), array_values($this->params), $this->sql), $this->sql, $this->params);
$stmt = $this->connbas->prepare($this->sql);
$stmt->execute($this->params);
$this->total_row = $stmt->rowCount();
$stmt->closeCursor();
$this->sql .= $this->filter->getLimitFilter() ?: '';
$this->sql .= $this->filter->getLimitFilter() ? : '';
}
else
{
@@ -141,14 +149,15 @@ class module_report_sqldownload extends module_report_sql implements module_repo
$this->sql .= ( $name == 'record_id' && $this->on == 'DOC') ? ' , final' : '';
if ($this->filter->getOrderFilter()) $this->sql .= $this->filter->getOrderFilter();
if ($this->filter->getOrderFilter())
$this->sql .= $this->filter->getOrderFilter();
$stmt = $this->connbas->prepare($this->sql);
$stmt->execute($this->params);
$this->total = $stmt->rowCount();
$stmt->closeCursor();
$this->sql .= $this->filter->getLimitFilter() ?: '';
$this->sql .= $this->filter->getLimitFilter() ? : '';
}
return $this;

View File

@@ -953,7 +953,7 @@ class system_file extends SplFileObject
= array($this->get_phrasea_tech_field(self::TECH_FIELD_SUBPATH));
$tfields[metadata_description_PHRASEANET_tfparentdir::get_source()]
= array($this->get_phrasea_tech_field(self::TECH_FIELD_PARENTDIRECTORY));
$tfields[metadata_description_PHRASEANET_tfparentdir::get_source()]
$tfields[metadata_description_PHRASEANET_tffilename::get_source()]
= array($this->get_phrasea_tech_field(self::TECH_FIELD_ORIGINALNAME));
$tfields[metadata_description_PHRASEANET_tfextension::get_source()]

View File

@@ -275,7 +275,15 @@ class task_Scheduler
* Launch task that are not yet launched
*/
$runningtask = 0;
$common_status = array(
task_abstract::STATUS_STARTED
, task_abstract::RETURNSTATUS_STOPPED
);
foreach ($ttask as $tkey => $tv)
{
if (!in_array($ttask[$tkey]["task"]->get_status(), $common_status))
{
$this->log(
sprintf(
@@ -284,9 +292,18 @@ class task_Scheduler
, $ttask[$tkey]["task"]->get_status()
)
);
}
switch ($ttask[$tkey]["task"]->get_status())
{
case 'torestart':
default:
$this->log(
sprintf(
'Unknow status `%s`'
, $ttask[$tkey]["task"]->get_status()
)
);
break;
case task_abstract::RETURNSTATUS_TORESTART:
@fclose($ttask[$tkey]["pipes"][1]);
@fclose($ttask[$tkey]["pipes"][2]);
@proc_close($ttask[$tkey]["process"]);
@@ -297,7 +314,7 @@ class task_Scheduler
$ttask[$tkey]["task"]->set_status(task_abstract::STATUS_TOSTART);
}
break;
case 'tostart':
case task_abstract::STATUS_TOSTART:
$ttask[$tkey]["killat"] = NULL;
if ($schedstatus == 'started' && !$ttask[$tkey]["process"])
{
@@ -380,7 +397,7 @@ class task_Scheduler
}
break;
case 'started':
case task_abstract::STATUS_STARTED:
$crashed = false;
/**
* If no process, the task is probably manually ran
@@ -437,7 +454,7 @@ class task_Scheduler
}
break;
case 'tostop':
case task_abstract::STATUS_TOSTOP:
if ($ttask[$tkey]["process"])
{
if ($ttask[$tkey]["killat"] === NULL)
@@ -487,8 +504,8 @@ class task_Scheduler
}
break;
case 'stopped':
case 'todelete':
case task_abstract::RETURNSTATUS_STOPPED:
case task_abstract::RETURNSTATUS_TODELETE:
if ($ttask[$tkey]["process"])
{
@fclose($ttask[$tkey]["pipes"][1]);
@@ -497,6 +514,7 @@ class task_Scheduler
$ttask[$tkey]["process"] = null;
}
break;
}
}

View File

@@ -43,7 +43,7 @@
<li class="{{class}} prevTrainCurrent" style="">
<img {{tooltip}} jsargs="REG|{{loop.index}}|{{regroupement.get_serialize_key}}"
class="openPreview prevRegToolTip" return(false);" src="{{thumbnail.get_url()}}"
class="openPreview prevRegToolTip" src="{{thumbnail.get_url()}}"
style="{{style}}margin:7px;position:relative;"/></li>
{% endfor %}

View File

@@ -24,7 +24,7 @@ $cls = 'task_period_' . $parm['cls'];
$registry = registry::get_instance();
$tskfile = $registry->get('GV_RootPath') . 'lib/classes/task/period/' . $parm['cls'] . '.class.php';
require_once $tskfile;
// require_once $tskfile;
$ztask = new $cls($parm['taskid']);

View File

@@ -396,8 +396,9 @@ function getHistory($obj, $param, $twig, $conf, $dl = false, $title)
elseif (!empty($param['on']) && !empty($param['user']))
$filter->addfilter($param['on'], '=', $param['user']);
if ($dl)
$filter->addfilter("(log_docs.final = 'document'", "OR", "log_docs.final = 'preview')");
{
$obj->setIsInformative(true);
}
$tab_filter = $filter->getTabFilter();
$obj->setFilter($tab_filter);

View File

@@ -948,7 +948,7 @@ function scid_click(event, el)
$('.basket_element', el).addClass('selected');
}
var sselcont_id = $(el).attr('id').split('_').pop();
var sselcont_id = $('.basket_element', el).attr('id').split('_').pop();
var ssel_id = $('#navigation').val();
var container = $('#sc_container');

View File

@@ -311,7 +311,7 @@ function scid_click(event, el)
$('.basket_element', el).addClass('selected');
}
var sselcont_id = $(el).attr('id').split('_').pop();
var sselcont_id = $('.basket_element', el).attr('id').split('_').pop();
var ssel_id = $('#navigation').val();
var container = $('#sc_container');

View File

@@ -129,6 +129,7 @@ iframe{
padding: 0 auto;
clear:both;
margin-bottom:10px;
overflow:auto;
}
.report-table table {
@@ -417,15 +418,11 @@ table.tablesorter tr th.SortDown {
}
.onload{
background-image:url(ajax-loader.gif);
background-position:center center;
background-repeat:no-repeat;
}
.onloadd{
background-image:url(ajax-loader2.gif);
background-position:center center;
background-repeat:no-repeat;
}
.ui-tabs, .ui-tabs .ui-tabs-panel{
padding:0;
}