Merge branch 'master' into PHRAS-2906-fix-for-job-and-activity-on-user-update

This commit is contained in:
Nicolas Maillat
2020-02-17 16:42:10 +01:00
committed by GitHub
25 changed files with 2910 additions and 2360 deletions

View File

@@ -16,7 +16,7 @@ class Version
/**
* @var string
*/
private $number = '4.1.0-alpha.19a';
private $number = '4.1.0-alpha.20a';
/**
* @var string

View File

@@ -42,7 +42,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
$ret = [
'text' => $this->app->trans('%user% a passe une %opening_link% commande %end_link%', [
'%user%' => $sender,
'%opening_link%' => '<a href="/prod/order/'.$order_id.'/" class="dialog full-dialog" title="'.$this->app->trans('Orders manager').'">',
'%opening_link%' => '<a href="#" class="order-notif" data-id="'.$order_id.'" title="'.$this->app->trans('Orders manager').'">',
'%end_link%' => '</a>',])
, 'class' => ''
];

View File

@@ -62,6 +62,16 @@ class patch_410alpha17a implements patchInterface
// $sql = "ALTER TABLE `metadatas_structure` ADD `gui_editable` INT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `readonly`";
// $databox->get_connection()->executeQuery($sql);
foreach ($databox->get_meta_structure() as $databox_field) {
if ($databox_field->get_tbranch() != '') {
$databox_field->set_generate_cterms(true);
} else {
$databox_field->set_generate_cterms(false);
}
$databox_field->save();
}
return true;
}
}

View File

@@ -0,0 +1,111 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2019 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Alchemy\Phrasea\Application;
class patch_410alpha20a implements patchInterface
{
/** @var string */
private $release = '4.1.0-alpha.20a';
/** @var array */
private $concern = [base::DATA_BOX];
/**
* Returns the release version.
*
* @return string
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return [];
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
// fix the Longitude value
$sql = 'SELECT id, record_id, name, value FROM technical_datas WHERE trim(name) = "LongitudeRef" ';
$stmt = $databox->get_connection()->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
foreach ($rs as $row) {
if (trim($row['value']) === 'W' ) {
$sql = 'UPDATE technical_datas SET value = CONCAT("-", value) WHERE trim(name) = "Longitude" AND record_id =:record_id';
$stmt = $databox->get_connection()->prepare($sql);
$stmt->execute([':record_id' => $row['record_id']]);
}
$sqlDelete = 'DELETE FROM technical_datas WHERE id =:id';
$stmt1 = $databox->get_connection()->prepare($sqlDelete);
$stmt1->execute([':id' => $row['id']]);
$stmt1->closeCursor();
}
$stmt->closeCursor();
// fix the Latitude value
$sql = 'SELECT id, record_id, name, value FROM technical_datas WHERE trim(name) = "LatitudeRef" ';
$stmt = $databox->get_connection()->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
foreach ($rs as $row) {
if (trim($row['value']) === 'S' ) {
$sql = 'UPDATE technical_datas SET value = CONCAT("-", value) WHERE trim(name) = "Latitude" AND record_id =:record_id';
$stmt = $databox->get_connection()->prepare($sql);
$stmt->execute([':record_id' => $row['record_id']]);
}
$sqlDelete = 'DELETE FROM technical_datas WHERE id =:id';
$stmt1 = $databox->get_connection()->prepare($sqlDelete);
$stmt1->execute([':id' => $row['id']]);
$stmt1->closeCursor();
}
$stmt->closeCursor();
return true;
}
}