Commit b88dbe63 authored by Florian Azizian's avatar Florian Azizian

Merge branch 'develop' into 'master'

Develop

See merge request maarch/MaarchCourrier!129
parents f662f6bf 2e22bee9
......@@ -757,7 +757,7 @@ class list_show_Abstract extends functions
$start = $_REQUEST['start'];
$param_comp .= '&start='.$start;
$param_comp .= '&start=0';
if ($name == 'structures' || $name == 'subfolders' || $name == 'types' || $name == 'contact_types' || $name == 'contact_purposes' || $name == 'contacts_v2' || $name == 'contacts_v2_up' || $name == 'contact_addresses_list') {
$link = $_SESSION['config']['businessappurl'].'index.php?page='.$name;
} else {
......
......@@ -257,11 +257,15 @@ if (!empty($tab)) {
$query .= '( ';
$query .= 'item_id IN (';
foreach ($_SESSION['user']['entities'] as $entitiestmpnote) {
$query .= '?, ';
$arrayPDOnotes = array_merge($arrayPDOnotes, array($entitiestmpnote['ENTITY_ID']));
if(!empty($_SESSION['user']['entities'])){
foreach ($_SESSION['user']['entities'] as $entitiestmpnote) {
$query .= '?, ';
$arrayPDOnotes = array_merge($arrayPDOnotes, array($entitiestmpnote['ENTITY_ID']));
}
$query = substr($query, 0, -2);
} else {
$query .= "''";
}
$query = substr($query, 0, -2);
$query .= ') ';
$query .= 'OR ';
......@@ -413,7 +417,7 @@ if (!empty($tab)) {
$tab[$i][$j]['show'] = false;
$tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
if (!empty($tab[$i][$j]['value'])) {
$user = \User\models\UserModel::getByLogin(['login' => $tab[$i][$j]['value'], 'select' => ['firstname', 'lastname']]);
$user = \User\models\UserModel::getByUserId(['userId' => $tab[$i][$j]['value'], 'select' => ['firstname', 'lastname']]);
$dest = $tab[$i][$j]['value'];
$dest = $user['firstname'] . ' ' . $user['lastname'];
} else {
......
......@@ -259,11 +259,15 @@ for ($i = 0; $i < $tabI; ++$i) {
$query .= '( ';
$query .= 'item_id IN (';
foreach ($_SESSION['user']['entities'] as $entitiestmpnote) {
$query .= '?, ';
$arrayPDOnotes = array_merge($arrayPDOnotes, array($entitiestmpnote['ENTITY_ID']));
if(!empty($_SESSION['user']['entities'])){
foreach ($_SESSION['user']['entities'] as $entitiestmpnote) {
$query .= '?, ';
$arrayPDOnotes = array_merge($arrayPDOnotes, array($entitiestmpnote['ENTITY_ID']));
}
$query = substr($query, 0, -2);
} else {
$query .= "''";
}
$query = substr($query, 0, -2);
$query .= ') ';
$query .= 'OR ';
......@@ -421,7 +425,7 @@ for ($i = 0; $i < $tabI; ++$i) {
$tab[$i][$j]['show'] = false;
$tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
if (!empty($tab[$i][$j]['value'])) {
$user = \User\models\UserModel::getByLogin(['login' => $tab[$i][$j]['value'], 'select' => ['firstname', 'lastname']]);
$user = \User\models\UserModel::getByUserId(['userId' => $tab[$i][$j]['value'], 'select' => ['firstname', 'lastname']]);
$dest = $tab[$i][$j]['value'];
$dest = $user['firstname'] . ' ' . $user['lastname'];
} else {
......
......@@ -416,15 +416,14 @@ if ($mode == 'normal') {
$query .= '( ';
$query .= 'item_id IN (';
foreach ($_SESSION['user']['entities'] as $entitiestmpnote) {
$query .= '?, ';
$arrayPDO = array_merge($arrayPDO, array($entitiestmpnote['ENTITY_ID']));
}
if ($_SESSION['user']['UserId'] == 'superadmin') {
$query .= ' null ';
} else {
if(!empty($_SESSION['user']['entities'])){
foreach ($_SESSION['user']['entities'] as $entitiestmpnote) {
$query .= '?, ';
$arrayPDO = array_merge($arrayPDO, array($entitiestmpnote['ENTITY_ID']));
}
$query = substr($query, 0, -2);
} else {
$query .= "''";
}
$query .= ') ';
......@@ -622,7 +621,7 @@ if ($mode == 'normal') {
if (!empty($_SESSION['searching']['where_request_parameters'][':destinataireChosen'])) {
foreach ($_SESSION['searching']['where_request_parameters'][':destinataireChosen'] as $key => $value) {
if ($value == $tab[$i][$j]['value']) {
$user = \User\models\UserModel::getByLogin(['login' => $value, 'select' => ['firstname', 'lastname']]);
$user = \User\models\UserModel::getByUserId(['userId' => $value, 'select' => ['firstname', 'lastname']]);
$target_dest = $value;
$target_dest = str_replace('%', '', $target_dest);
$dest = $tab[$i][$j]['value'];
......@@ -632,7 +631,7 @@ if ($mode == 'normal') {
}
} else {
if (!empty($tab[$i][$j]['value'])) {
$user = \User\models\UserModel::getByLogin(['login' => $tab[$i][$j]['value'], 'select' => ['firstname', 'lastname']]);
$user = \User\models\UserModel::getByUserId(['userId' => $tab[$i][$j]['value'], 'select' => ['firstname', 'lastname']]);
$dest = $tab[$i][$j]['value'];
$dest = $user['firstname'] . ' ' . $user['lastname'];
} else {
......
......@@ -1842,7 +1842,11 @@ function loadIndexingModel(actionId) {
$j.each(content, function( index, value ) {
if ($j('#'+index).length) {
$j('#'+index).val(value);
if (index == 'destination' && $j('#'+index+' option[value="'+value+'"]').is(':disabled')) {
//do nothing
} else {
$j('#'+index).val(value);
}
$j('#category_id').change();
if ($j('#'+index).is('select') && index != 'thesaurus') {
......
......@@ -53,15 +53,14 @@ if (isset($_REQUEST['identifier'])) {
$query .= "( ";
$query .= "item_id IN (";
foreach ($_SESSION['user']['entities'] as $entitiestmpnote) {
$query .= "?, ";
$arrayPDO = array_merge($arrayPDO, array($entitiestmpnote['ENTITY_ID']));
}
if ($_SESSION['user']['UserId'] == 'superadmin') {
$query .= " null ";
} else {
if(!empty($_SESSION['user']['entities'])){
foreach ($_SESSION['user']['entities'] as $entitiestmpnote) {
$query .= "?, ";
$arrayPDO = array_merge($arrayPDO, array($entitiestmpnote['ENTITY_ID']));
}
$query = substr($query, 0, -2);
} else {
$query .= "''";
}
$query .= ") ";
......@@ -158,4 +157,4 @@ if (isset($_REQUEST['identifier'])) {
}
echo "{status : " . $status . ", toShow : '" . addslashes($return) . "'}";
exit();
\ No newline at end of file
exit();
......@@ -114,7 +114,7 @@ class security extends Database
} else {
$comp = " and STATUS <> 'DEL' "
.'and loginmode in (:loginmode1)';
$params = ['loginmode1' => ['standard', 'sso', 'cas']];
$params = ['loginmode1' => ['standard', 'sso', 'cas', 'ozwillo']];
if ($method == 'restMode') {
array_push($params['loginmode1'], 'restMode');
}
......
This diff is collapsed.
......@@ -22,202 +22,6 @@
src: local('Arizonia'), local('Arizonia-Regular'), url('fonts/sonsieOne.woff') format('woff');
}
/* header.css */
#fullWrapper #header {
height: 120px;
width: 910px;
text-align: left;
}
#fullWrapper #header .headerName {
position: relative;
top: 18px;
left: 0px;
float: left;
}
#fullWrapper #header .headerName h2 {
font-size: 70px;
font-family: 'Contrail One';
color: rgba(81, 112, 144, 1);
}
#fullWrapper #header .logo {
position: relative;
top: 17px;
right: 0px;
float: right;
}
/* footer.css */
#fullWrapper #footer {
height: 125px;
width: 910px;
text-align: left;
}
/* section.css */
#fullWrapper #section {
}
#fullWrapper #section .blockWrapper #progressWrapper{
font-family: 'Sonsie One';
color: rgba(255, 255, 255, 0.9);
font-weight: bold;
font-size: 30px;
}
#fullWrapper #section .blockWrapper {
width: 910px;
background-color: rgba(224, 224, 224, 0.5);
text-align: left;
}
#fullWrapper #section .blockWrapper .titleBlock {
}
#fullWrapper #section .blockWrapper .titleBlock h2 {
font-size: 35px;
font-family: 'Contrail One';
background-color: rgba(224, 224, 224, 0.8);
padding-top: 15px;
padding-bottom: 10px;
padding-left: 20px;
padding-right: 20px;
}
#fullWrapper #section .blockWrapper .contentBlock {
}
#fullWrapper #section .blockWrapper .contentBlock p {
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
text-align: justify;
}
#fullWrapper #section .blockWrapper .contentBlock h6 {
padding-top: 0;
padding-bottom: 0;
padding-left: 15px;
padding-right: 15px;
margin: 0;
margin-bottom: 10px;
text-align: justify;
}
#fullWrapper #section .blockWrapper .contentBlock .previousButton {
position: relative;
left: 25px;
}
#fullWrapper #section .blockWrapper .contentBlock .nextButton {
position: relative;
right: 25px;
}
#fullWrapper #section .blockWrapper .contentBlock form {
padding-left: 15px;
padding-right: 15px;
}
#fullWrapper #section .blockWrapper .contentBlock table {
padding-left: 15px;
padding-right: 15px;
}
#fullWrapper #section .blockWrapper .contentBlock table .voyantPrerequisites {
width: 30px;
}
/* tags.css */
body {
margin: 0;
background-color: rgba(224, 224, 224, 1);
font-family: "Trebuchet MS";
}
h2 {
margin: 0;
padding: 0;
font-weight: normal;
}
p {
margin: 0;
padding: 0;
font-weight: normal;
}
form {
margin: 0;
padding: 0;
}
table {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
color: rgba(255, 255, 255, 0.7);
font-weight: bold;
font-family: 'Sonsie One';
}
a:hover {
color: rgba(255, 255, 255, 1);
}
/* image-picker.css */
ul.thumbnails.image_picker_selector {
overflow: auto;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul.thumbnails.image_picker_selector ul {
overflow: auto;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul.thumbnails.image_picker_selector li.group {
width:100%;
}
ul.thumbnails.image_picker_selector li.group_title {
float: none;
}
ul.thumbnails.image_picker_selector li {
margin: 0px 12px 12px 0px;
float: left;
}
ul.thumbnails.image_picker_selector li .thumbnail {
padding: 6px;
border: 1px solid #dddddd;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
ul.thumbnails.image_picker_selector li .thumbnail img {
-webkit-user-drag: none;
}
ul.thumbnails.image_picker_selector li .thumbnail.selected {
background: #0088cc;
}
.image_picker_image {
width: 200px;
}
/* buttons.css */
#buttons #next a {
/* background-color: #64b651; */
......@@ -442,6 +246,126 @@ ul.thumbnails.image_picker_selector li .thumbnail.selected {
}
/* section.css */
#fullWrapper #section {
}
#fullWrapper #section .blockWrapper #progressWrapper{
font-family: 'Sonsie One';
color: rgba(255, 255, 255, 0.9);
font-weight: bold;
font-size: 30px;
}
#fullWrapper #section .blockWrapper {
width: 910px;
background-color: rgba(224, 224, 224, 0.5);
text-align: left;
}
#fullWrapper #section .blockWrapper .titleBlock {
}
#fullWrapper #section .blockWrapper .titleBlock h2 {
font-size: 35px;
font-family: 'Contrail One';
background-color: rgba(224, 224, 224, 0.8);
padding-top: 15px;
padding-bottom: 10px;
padding-left: 20px;
padding-right: 20px;
}
#fullWrapper #section .blockWrapper .contentBlock {
}
#fullWrapper #section .blockWrapper .contentBlock p {
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
text-align: justify;
}
#fullWrapper #section .blockWrapper .contentBlock h6 {
padding-top: 0;
padding-bottom: 0;
padding-left: 15px;
padding-right: 15px;
margin: 0;
margin-bottom: 10px;
text-align: justify;
}
#fullWrapper #section .blockWrapper .contentBlock .previousButton {
position: relative;
left: 25px;
}
#fullWrapper #section .blockWrapper .contentBlock .nextButton {
position: relative;
right: 25px;
}
#fullWrapper #section .blockWrapper .contentBlock form {
padding-left: 15px;
padding-right: 15px;
}
#fullWrapper #section .blockWrapper .contentBlock table {
padding-left: 15px;
padding-right: 15px;
}
#fullWrapper #section .blockWrapper .contentBlock table .voyantPrerequisites {
width: 30px;
}
/* image-picker.css */
ul.thumbnails.image_picker_selector {
overflow: auto;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul.thumbnails.image_picker_selector ul {
overflow: auto;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul.thumbnails.image_picker_selector li.group {
width:100%;
}
ul.thumbnails.image_picker_selector li.group_title {
float: none;
}
ul.thumbnails.image_picker_selector li {
margin: 0px 12px 12px 0px;
float: left;
}
ul.thumbnails.image_picker_selector li .thumbnail {
padding: 6px;
border: 1px solid #dddddd;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
ul.thumbnails.image_picker_selector li .thumbnail img {
-webkit-user-drag: none;
}
ul.thumbnails.image_picker_selector li .thumbnail.selected {
background: #0088cc;
}
.image_picker_image {
width: 200px;
}
/* general.css */
#fullWrapper {
width: 960px;
......@@ -472,3 +396,79 @@ h6 {
/* tags.css */
body {
margin: 0;
background-color: rgba(224, 224, 224, 1);
font-family: "Trebuchet MS";
}
h2 {
margin: 0;
padding: 0;
font-weight: normal;
}
p {
margin: 0;
padding: 0;
font-weight: normal;
}
form {
margin: 0;
padding: 0;
}
table {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
color: rgba(255, 255, 255, 0.7);
font-weight: bold;
font-family: 'Sonsie One';
}
a:hover {
color: rgba(255, 255, 255, 1);
}
/* header.css */
#fullWrapper #header {
height: 120px;
width: 910px;
text-align: left;
}
#fullWrapper #header .headerName {
position: relative;
top: 18px;
left: 0px;
float: left;
}
#fullWrapper #header .headerName h2 {
font-size: 70px;
font-family: 'Contrail One';
color: rgba(81, 112, 144, 1);
}
#fullWrapper #header .logo {
position: relative;
top: 17px;
right: 0px;
float: right;
}
/* footer.css */
#fullWrapper #footer {
height: 125px;
width: 910px;
text-align: left;
}
This diff is collapsed.
......@@ -2,54 +2,25 @@
function setConfigSendmail_batch_config_Xml($from, $to, $host, $user, $pass, $type, $port, $auth, $charset, $smtpSecure, $mailfrom, $smtpDomains)
{
$xmlconfig = simplexml_load_file(realpath('.').'/custom/cs_'.$_SESSION['config']['databasename'].'/modules/sendmail/batch/config/config.xml');
\SrcCore\models\DatabasePDO::reset();
new \SrcCore\models\DatabasePDO(['customId' => 'cs_'.$_SESSION['config']['databasename']]);
$CONFIG = $xmlconfig->CONFIG;
$CONFIG->MaarchDirectory = realpath('.')."/";
if ($_SERVER['REMOTE_ADDR'] == '::1') {
$REMOTE_ADDR = 'localhost';
} else {
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
if (!empty($pass)) {
$pass = \SrcCore\models\PasswordModel::encrypt(['password' => $pass]);
}
$chemin = $REMOTE_ADDR . dirname($_SERVER['PHP_SELF']);
$maarchUrl = rtrim($chemin, "install");
$maarchUrl = $maarchUrl . 'cs_'.$_SESSION['config']['databasename'].'/';
$CONFIG->MaarchUrl = $maarchUrl;
$CONFIG->MaarchApps = 'maarch_entreprise';
$CONFIG->TmpDirectory = realpath('.').'/modules/sendmail/batch/tmp/';
$MAILER = $xmlconfig->MAILER;
$MAILER->type = $type;
$MAILER->smtp_port = $port;
$MAILER->smtp_host = $host;
$MAILER->smtp_user = $user;
$MAILER->smtp_password = $pass;
//$MAILER->mailfrom = $mailfrom;
$MAILER->domains = $smtpDomains;
if ($auth == 1) {
$MAILER->smtp_auth = "true";
} else {
$MAILER->smtp_auth = "false";
}
$LOG4PHP = $xmlconfig->LOG4PHP;
$LOG4PHP->Log4PhpConfigPath = realpath('.').'/custom/cs_'.$_SESSION['config']['databasename'].'/apps/maarch_entreprise/xml/log4php.xml';
$res = $xmlconfig->asXML();
$fp = @fopen(realpath('.')."/custom/cs_".$_SESSION['config']['databasename']."/modules/sendmail/batch/config/config.xml", "w+");
if (!$fp) {
return false;
exit;
}
$write = fwrite($fp, $res);
if (!$write) {
return false;
exit;
}
$data = [
'type' => $type,
'host' => $host,
'port' => $port,
'user' => $user,
'password' => $pass,
'auth' => $auth == 1,
'secure' => 'ssl',
'charset' => 'utf-8'
];
$data = json_encode($data);
\Configuration\models\ConfigurationModel::update(['set' => ['value' => $data], 'where' => ['service = ?'], 'data' => ['admin_email_server']]);
}
......
#!/bin/sh
php ./migrateSendmail.php
<?php
require '../../vendor/autoload.php';
chdir('../..');
$migrated = 0;
$customs = scandir('custom');
foreach ($customs as $custom) {
if ($custom == 'custom.xml' || $custom == '.' || $custom == '..') {
continue;
}
\SrcCore\models\DatabasePDO::reset();
new \SrcCore\models\DatabasePDO(['customId' => $custom]);
$xmlfile = null;
$path = "custom/{$custom}/modules/sendmail/batch/config/config.xml";
if (file_exists($path)) {
$xmlfile = simplexml_load_file($path);
}
if ($xmlfile) {
$pass = '';
if (!empty((string)$xmlfile->MAILER->smtp_password)) {
$pass = \SrcCore\models\PasswordModel::encrypt(['password' => (string)$xmlfile->MAILER->smtp_password]);
}
$data = [
'type' => (string)$xmlfile->MAILER->type,
'host' => (string)$xmlfile->MAILER->smtp_host,
'port' => (int)$xmlfile->MAILER->smtp_port,
'user' => (string)$xmlfile->MAILER->smtp_user,
'password' => $pass,
'auth' => (string)$xmlfile->MAILER->smtp_auth == 'true' ? true : false,