Merge branch '3.8'

This commit is contained in:
Romain Neutron
2013-09-02 17:22:18 +02:00
19 changed files with 48 additions and 45 deletions

View File

@@ -270,7 +270,7 @@ class Edit implements ControllerProviderInterface
$controllers->post('/apply/', function(Application $app, Request $request) { $controllers->post('/apply/', function(Application $app, Request $request) {
$records = RecordsRequest::fromRequest($app, $request, true, array('canmodifrecord')); $records = RecordsRequest::fromRequest($app, $request, RecordsRequest::FLATTEN_YES_PRESERVE_STORIES, array('canmodifrecord'));
if (count($records->databoxes()) !== 1) { if (count($records->databoxes()) !== 1) {
throw new \Exception('Unable to edit on multiple databoxes'); throw new \Exception('Unable to edit on multiple databoxes');

View File

@@ -122,10 +122,6 @@ class module_console_taskrun extends Command
$logger->pushHandler($handler); $logger->pushHandler($handler);
} }
$logfile = __DIR__ . '/../../../../logs/task_' . $task_id . '.log';
$handler = new RotatingFileHandler($logfile, 10);
$logger->pushHandler($handler);
$this->task = $task_manager->getTask($task_id, $logger); $this->task = $task_manager->getTask($task_id, $logger);
register_tick_function(array($this, 'tick_handler'), true); register_tick_function(array($this, 'tick_handler'), true);

View File

@@ -34,19 +34,12 @@ class recordutils_image extends recordutils
$palette = new RGB(); $palette = new RGB();
} }
$xmlToColor = function($attr, $ret = array(255, 255, 255, 0)) use ($palette) { $xmlToColor = function($attr, $ret = array(255, 255, 255)) use ($palette) {
foreach (explode(',', $attr) as $i => $v) { try {
if ($i > 3) { return $palette->color($attr, 0);
break; } catch (ImagineException $e) {
return $palette->color($ret);
} }
$v = (int) (trim($v));
if ($v >= 0 && ($v <= 100 || ($i < 3 && $v < 256))) {
$ret[$i] = $v;
}
}
$alpha = array_pop($ret);
return $palette->color($ret, $alpha);
}; };
$base_id = $subdef->get_record()->get_base_id(); $base_id = $subdef->get_record()->get_base_id();
@@ -151,7 +144,7 @@ class recordutils_image extends recordutils
for ($istamp = 0; $istamp < $stampNodes->length; $istamp++) { for ($istamp = 0; $istamp < $stampNodes->length; $istamp++) {
$stamp = $stampNodes->item($istamp); $stamp = $stampNodes->item($istamp);
$stamp_background = $xmlToColor($stamp->getAttribute('background'), array(255, 255, 255, 0)); $stamp_background = $xmlToColor($stamp->getAttribute('background'), array(255, 255, 255));
$stamp_position = strtoupper(trim($stamp->getAttribute('position'))); $stamp_position = strtoupper(trim($stamp->getAttribute('position')));
if (!in_array($stamp_position, array('TOP', 'TOP-OVER', 'BOTTOM-OVER', 'BOTTOM'))) { if (!in_array($stamp_position, array('TOP', 'TOP-OVER', 'BOTTOM-OVER', 'BOTTOM'))) {
@@ -267,7 +260,7 @@ class recordutils_image extends recordutils
$wrap = static::wrap($app['imagine'], $fontsize, 0, __DIR__ . '/arial.ttf', $txtline, $text_width); $wrap = static::wrap($app['imagine'], $fontsize, 0, __DIR__ . '/arial.ttf', $txtline, $text_width);
$txtblock[] = array( $txtblock[] = array(
'fontsize' => $fontsize, 'fontsize' => $fontsize,
'fontcolor' => $xmlToColor($texts->item($i)->getAttribute('color'), array(0, 0, 0, 0)), 'fontcolor' => $xmlToColor($texts->item($i)->getAttribute('color'), array(0, 0, 0)),
'h' => $wrap['toth'], 'h' => $wrap['toth'],
'lines' => $wrap['l'] 'lines' => $wrap['l']
); );
@@ -308,7 +301,7 @@ class recordutils_image extends recordutils
$font = $app['imagine']->font(__DIR__ . '/arial.ttf', $block['fontsize'], $block['fontcolor']); $font = $app['imagine']->font(__DIR__ . '/arial.ttf', $block['fontsize'], $block['fontcolor']);
foreach ($block['lines'] as $line) { foreach ($block['lines'] as $line) {
if ($line['t'] != '') { if ($line['t'] != '') {
$draw->text($line['t'], $font, new Point(0, $txt_ypos), 0); $draw->text($line['t'], $font, new Point($logo_reswidth, $txt_ypos), 0);
} }
$txt_ypos += $line['h']; $txt_ypos += $line['h'];
} }

View File

@@ -398,7 +398,10 @@ abstract class task_abstract
throw new \LogicException('This method must be implemented'); throw new \LogicException('This method must be implemented');
} }
abstract public function help(); public static function help()
{
throw new \LogicException('This method must be implemented');
}
/** /**
* *

View File

@@ -25,7 +25,7 @@ class task_period_RecordMover extends task_appboxAbstract
* *
* @return string * @return string
*/ */
public function help() public static function help()
{ {
return ''; return '';
} }

View File

@@ -25,7 +25,7 @@ class task_period_apibridge extends task_appboxAbstract
* Get help * Get help
* @return string * @return string
*/ */
public function help() public static function help()
{ {
return ''; return '';
} }

View File

@@ -284,7 +284,7 @@ class task_period_archive extends task_abstract
* *
* @return string * @return string
*/ */
public function help() public static function help()
{ {
return _("task::archive:Archiving files found into a 'hotfolder'"); return _("task::archive:Archiving files found into a 'hotfolder'");
} }

View File

@@ -108,7 +108,7 @@ class task_period_cindexer extends task_abstract
* *
* @return string * @return string
*/ */
public function help() public static function help()
{ {
return(_("This task is used to index records for Phrasea engine.")); return(_("This task is used to index records for Phrasea engine."));
} }

View File

@@ -27,7 +27,7 @@ class task_period_emptyColl extends task_appboxAbstract
return false; return false;
} }
public function help() public static function help()
{ {
return("Vide une collection"); return("Vide une collection");
} }

View File

@@ -33,7 +33,7 @@ class task_period_ftp extends task_appboxAbstract
* *
* @return string * @return string
*/ */
public function help() public static function help()
{ {
return ''; return '';
} }

View File

@@ -28,7 +28,7 @@ class task_period_ftpPull extends task_appboxAbstract
return(_("task::ftp:FTP Pull")); return(_("task::ftp:FTP Pull"));
} }
public function help() public static function help()
{ {
return ''; return '';
} }

View File

@@ -41,7 +41,7 @@ class task_period_subdef extends task_databoxAbstract
* *
* @return <type> * @return <type>
*/ */
public function help() public static function help()
{ {
return( return(
_("task::subdef:creation des sous definitions des documents d'origine") _("task::subdef:creation des sous definitions des documents d'origine")

View File

@@ -17,7 +17,7 @@ class task_period_test extends task_appboxAbstract
return "Test"; return "Test";
} }
public function help() public static function help()
{ {
return "just saying what i'm doing"; return "just saying what i'm doing";
} }

View File

@@ -19,7 +19,7 @@ class task_period_writemeta extends task_databoxAbstract
protected $clear_doc; protected $clear_doc;
protected $metasubdefs = array(); protected $metasubdefs = array();
public function help() public static function help()
{ {
return(_("task::writemeta:(re)ecriture des metadatas dans les documents (et subdefs concernees)")); return(_("task::writemeta:(re)ecriture des metadatas dans les documents (et subdefs concernees)"));
} }

View File

@@ -220,10 +220,10 @@
<button type="button" name="watermark[]" value="{{ row['usr_id'] }}_{{ basId }}" onclick="checkAdd(this)" id="{{ 'watermark_' ~ row['usr_id'] ~ '_' ~ basId }}" class="btn {{ 'disabler_' ~ row['usr_id'] ~ '_' ~ basId }} watermark_checker tipInfoUsr {{ 'checker_' ~ row['usr_id'] }}" title="{% trans 'admin:: watermarquer les documents' %}" style="height:30px;"> <button type="button" name="watermark[]" value="{{ row['usr_id'] }}_{{ basId }}" onclick="checkAdd(this)" id="{{ 'watermark_' ~ row['usr_id'] ~ '_' ~ basId }}" class="btn {{ 'disabler_' ~ row['usr_id'] ~ '_' ~ basId }} watermark_checker tipInfoUsr {{ 'checker_' ~ row['usr_id'] }}" title="{% trans 'admin:: watermarquer les documents' %}" style="height:30px;">
<span class="tipInfoUsr" title="{% trans 'admin:: watermarquer les documents' %}">W</span> <span class="tipInfoUsr" title="{% trans 'admin:: watermarquer les documents' %}">W</span>
</button> </button>
<button class="btn btn-warning" disabled style="height:30px;">
{{ basId| bas_labels(app) }}
</button>
</div> </div>
<h1 style="word-wrap: break-word;">
{{ basId| bas_labels(app) }}
</h1>
{% endfor %} {% endfor %}
</td> </td>
<td> <td>

View File

@@ -38,7 +38,7 @@
{% endfor %} {% endfor %}
</select> </select>
<div class="form-actions"> <div class="form-actions">
<button class="btn btn-primary" type="submit">{% trans %}Save changes{% endtrans %}</button> <button class="btn btn-primary" type="submit">{% trans 'boutton::valider' %}</button>
<a href="{{ path('users_display_import_file') }}" target="right" class="btn">{% trans %}Cancel{% endtrans %}</a> <a href="{{ path('users_display_import_file') }}" target="right" class="btn">{% trans %}Cancel{% endtrans %}</a>
</div> </div>
</form> </form>

View File

@@ -140,8 +140,10 @@ var p4 = p4 || {};
modal:true, modal:true,
width:width, width:width,
height:height, height:height,
close:CloseCallback, open: function() {
zIndex:zIndex $(this).dialog("widget").css("z-index", zIndex);
},
close:CloseCallback
}) })
.dialog('open').addClass('dialog-' + this.options.size); .dialog('open').addClass('dialog-' + this.options.size);

View File

@@ -2075,8 +2075,7 @@ $('#EDIT_MID_R')
}; };
$("#Edit_copyPreset_dlg", p4.edit.editBox).dialog( { $("#Edit_copyPreset_dlg", p4.edit.editBox).dialog({
zIndex:5000,
stack:true, stack:true,
closeOnEscape:true, closeOnEscape:true,
resizable:false, resizable:false,
@@ -2085,8 +2084,11 @@ $('#EDIT_MID_R')
modal:true, modal:true,
width:600, width:600,
title:language.newPreset, title:language.newPreset,
open:function(event, ui) close: function(event,ui) {
{ $(this).dialog("widget").css("z-index", "auto");
},
open:function(event, ui) {
$(this).dialog("widget").css("z-index", "5000");
$(".EDIT_presetTitle")[0].focus(); $(".EDIT_presetTitle")[0].focus();
}, },
buttons:buttons buttons:buttons

View File

@@ -692,13 +692,15 @@ function triggerShortcuts()
modal:true, modal:true,
width:600, width:600,
height:400, height:400,
zIndex:1400,
overlay: { overlay: {
backgroundColor: '#000', backgroundColor: '#000',
opacity: 0.7 opacity: 0.7
}, },
open: function(event, ui) {
$(this).dialog("widget").css("z-index", "1400");
},
close : function(){ close : function(){
$(this).dialog("widget").css("z-index", "auto");
if($('#keyboard-stop').get(0).checked) { if($('#keyboard-stop').get(0).checked) {
var dialog = $('#keyboard-dialog'); var dialog = $('#keyboard-dialog');
if (dialog.data("ui-dialog")) { if (dialog.data("ui-dialog")) {
@@ -2382,7 +2384,12 @@ function printThis(value)
modal:true, modal:true,
width:'800', width:'800',
height:'500', height:'500',
zIndex: 1999 open: function(event, ui) {
$(this).dialog("widget").css("z-index", "1999");
},
close: function(event, ui) {
$(this).dialog("widget").css("z-index", "auto");
}
}) })
.dialog('open'); .dialog('open');