Commit 82b2cf87 by Giovannoni Laurent

Merge branch 'develop' into 'master'

Develop

See merge request !42
parents 019610ac dc7c4607
Showing with 1510 additions and 642 deletions
# Maarch_Courrier
Maarch Courrier : Gestionnaire Électronique de Courrier
# Maarch Courrier
Gestionnaire Électronique de Correspondances – Libre et Open Source –
**/!\ Version de développement**
**Dernière version stable V17.06**
Démonstration : http://demo.maarchcourrier.com/
Build : https://sourceforge.net/projects/maarch/files/Maarch%20Courrier/MaarchCourrier-17.06.tar.gz
VM : https://sourceforge.net/projects/maarch/files/Maarch%20Courrier/VMs/Maarch%20Courrier%2017.06%20Prod.ova
Documentation : http://wiki.maarch.org/Maarch_Courrier
## Installation
1. Vérifiez que vous avez l'ensemble des [pré-requis](http://wiki.maarch.org/Maarch_Courrier/fr/Install/Prerequis/latest)
2. Décompressez *MaarchCourrier-17.06.tar.gz* dans votre zone web
3. Vérifiez votre vhost Apache
4. Laissez-vous guider par notre installeur à [http://IP.ouDomaine.tld/MaarchCourrier/install/](http://wiki.maarch.org/Maarch_Courrier/1.5/fr/Manuel_administrateur/Fonctionnalit%C3%A9s/Gestion_installeur$
Dernière version stable V17.06 : http://wiki.maarch.org/Maarch_Courrier
Démonstration en ligne : http://demo.maarchcourrier.com/
## Requis techniques
* Apache2.x
* PostgreSQL 9.x
* PHP 5.6 ou plus, MaarchCourrier 17.06 est compatible avec php7 !
* Extensions : php_xsl, php_xmlrpc, php_gettext, php_gd, php_pgsql, php_mbstring, php_pdo_pgsql, php5-mcrypt, php_imap, php_soap
* Spécifique Windows : php php_pdo_pgsql.dll, php php_fileinfo.dll
* PHP 5.6.* ou PHP 7.0.*
* Extensions PHP (adaptées à votre version de PHP) : PHP-[XSL](http://php.net/manual/en/book.xsl.php), PHP-[XML-RPC](http://php.net/manual/en/book.xmlrpc.php), PHP-[Gettext](http://php.net/manual/en/b$
* Bibliothèques pear/SOAP (pour php < 7.0), pear/CLITools
* imagick, php_imagick
* ghostscript
* 7z (p7z-full sous gnu/linux)
* wkhtmltopdf, wkhtmltoimage (http://wkhtmltopdf.org/downloads.html)
* LibreOffice (pour la conversion de documents)
* JRE >= 7
* [ImageMagick](http://imagemagick.org/), avec PHP-[ImageMagick](http://php.net/manual/en/book.imagick.php)
* [Ghostscript](https://www.ghostscript.com/)
* [7-zip](http://www.7-zip.org/)
* [wkhtmltopdf et wkhtmltoimage](http://wkhtmltopdf.org/downloads.html)
* [LibreOffice](http://libreoffice.org/) pour la conversion de documents
* Java Runtime Environment >= 7
### Recommandations pour le php.ini
php > 5.6 : error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
display_errors (On)
short_open_tags (On)
magic_quotes_gpc (Off)
## Le coin des developpeurs
[Maarch Developer handbook](http://wiki.maarch.org/Maarch_Courrier/1.5/fr/Install/DeveloperHandbook)
<div *ngIf="loading">
<i class="fa fa-spinner fa-spin fa-5x" style="margin-left: 50%;margin-top: 16%;font-size: 8em"></i>
</div>
<div *ngIf="!loading" class="container-fluid">
<h1 style="margin-top: 0"><i class="fa fa-cogs fa-2x"></i> Administration</h1>
<div class="row row-eq-height">
<div *ngIf="applicationServices[0]" class="col-md-12 servicesDiv">
<h2 class="administrationTitle">Application</h2>
<div class="content">
<div *ngFor="let appService of applicationServices" class="admin_item" title="{{appService.comment}}" (click)="goToSpecifiedAdministration(appService)">
<div>
<i class="{{appService.style}} fa-4x"></i>
</div>
<div>
<strong>{{appService.name}}</strong>
</div>
</div>
</div>
</div>
<div *ngIf="modulesServices[0]" class="col-md-12 servicesDiv">
<h2 class="administrationTitle">Modules</h2>
<div class="content">
<div *ngFor="let modService of modulesServices" class="admin_item" title="{{modService.comment}}" (click)="goToSpecifiedAdministration(modService)">
<div>
<i class="{{modService.style}} fa-4x"></i>
</div>
<div>
<strong>{{modService.name}}</strong>
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -15,11 +15,8 @@
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<!--<li>-->
<!--<a data-toggle="modal" data-target="#manageAbs" (click)="getAbsenceInfos()"><i class="fa fa-user-times" title=""></i> {{user.lang.manageAbsences}} </a>-->
<!--</li>-->
<li style="cursor: pointer">
<a (click)="absenceModal()" ><i class="fa fa-user-times"></i> {{user.lang.manageAbsences}} </a>
<a data-toggle="modal" data-target="#manageAbs"><i class="fa fa-user-times" title=""></i> {{user.lang.manageAbsences}} </a>
</li>
<li style="cursor: pointer">
<a data-toggle="modal" data-target="#manageSign"><i class="fa fa-vcard-o"></i> {{user.lang.manageSignatures}} </a>
......@@ -141,39 +138,53 @@
</div>
<div id="manageAbs" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{user.lang.manageAbsences}}</h4>
</div>
<div class="modal-body">
<div class="alert alert-danger" role="alert">Vous allez être <strong>automatiquement déconnecté</strong> après avoir défini vos redirections de bannettes</div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<form class="navbar-form navbar-left">
<div class="form-group">
<select class="form-control" placeholder="Bannette(s) à rediriger"><option>Courrier à signer</option></select>
<span>&nbsp;vers&nbsp;</span>
<input type="text" class="form-control" placeholder="Utilisateur">
</div>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#" title="Sauvegarder la modification"><i class="fa fa-plus"></i></a></li>
</ul>
</div>
</nav>
<ul class="list-group">
<li class="list-group-item"><i class="fa fa-tasks"></i> Mes courriers à traiter <span class="pull-right"><span class="label label-primary">Barbarain BAIN</span> <a href="#" title="Supprimer"><i class="fa fa-trash" style="color:red;"></i></a></span></li>
<li class="list-group-item"><i class="fa fa-tasks"></i> Mes courriers à viser <span class="pull-right"><span class="label label-primary">Patricia PETIT</span> <a href="#" title="Supprimer"><i class="fa fa-trash" style="color:red;"></i></a></span></li>
</ul>
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{user.lang.manageAbsences}}</h4>
</div>
<div class="modal-body">
<div class="alert alert-danger" role="alert">{{user.lang.autoLogout}}</div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<form class="navbar-form navbar-left">
<div class="form-group">
<select id="selectBasketAbsenceUser" class="form-control">
<option>Bannette(s) à rediriger</option>
<option *ngFor="let basket of user.baskets" [disabled]="basket.disabled">
{{basket.basket_name}}
<span *ngIf="basket.userToDisplay">({{basket.userToDisplay}})</span>
</option>
</select>
<span>&nbsp;{{user.lang.to}}&nbsp;</span>
</div>
<div class="form-group typeahead__container">
<div class="typeahead__field">
<input id="absenceUser" type="text" class="form-control" placeholder="{{user.lang.user}}" autocomplete="off">
</div>
</div>
</form>
<ul class="nav navbar-nav navbar-right" (click)="addBasketRedirection()" style="cursor: pointer">
<li><a title="{{user.lang.saveModification}}"><i class="fa fa-plus"></i></a></li>
</ul>
</div>
</nav>
<ul class="list-group">
<li class="list-group-item" *ngFor="let uam of userAbsenceModel; let i = index">
<i class="fa fa-tasks" title="{{uam.basketId}}"></i> {{uam.basketName}}
<span class="pull-right">
<span class="label label-primary">{{uam.newUser}}</span>
<a (click)="delBasketRedirection(i)" style="cursor: pointer" title="{{user.lang.delete}}"><i class="fa fa-trash" style="color:red;"></i></a>
</span>
</li>
</ul>
</div>
<div class="modal-footer">
<button type="button" (click)="activateAbsence()" class="btn btn-default">{{user.lang.activateAbs}}</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default">Activer mon absence</button>
</div>
</div>
</div>
</div>
<div id="manageSign" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
......
......@@ -151,7 +151,7 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module
//Load multicontacts
$query = "SELECT c.firstname, c.lastname, c.society, c.contact_id, c.ca_id ";
$query .= "FROM view_contacts c, contacts_res cres ";
$query .= "WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (c.contact_id as varchar) = cres.contact_id AND c.ca_id = cres.address_id ";
$query .= "WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (c.contact_id as varchar(128)) = cres.contact_id AND c.ca_id = cres.address_id ";
$query .= "GROUP BY c.firstname, c.lastname, c.society, c.contact_id, c.ca_id";
$stmt = $db->query($query, array($res_id));
......@@ -172,7 +172,7 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module
}
$query = "select u.firstname, u.lastname, u.user_id ";
$query .= "from users u, contacts_res cres ";
$query .= "where cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (u.user_id as varchar) = cres.contact_id ";
$query .= "where cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (u.user_id as varchar(128)) = cres.contact_id ";
$query .= "GROUP BY u.firstname, u.lastname, u.user_id";
$stmt = $db->query($query, array($res_id));
......
......@@ -248,7 +248,7 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module
$query = "SELECT c.is_corporate_person, c.is_private, c.contact_lastname, c.contact_firstname, c.society, c.society_short, c.contact_purpose_id, c.address_num, c.address_street, c.address_postal_code, c.address_town, c.lastname, c.firstname, c.contact_id, c.ca_id ";
$query .= "FROM view_contacts c, contacts_res cres ";
$query .= "WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (c.contact_id as varchar) = cres.contact_id AND c.ca_id = cres.address_id";
$query .= "WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (c.contact_id as varchar(128)) = cres.contact_id AND c.ca_id = cres.address_id";
$stmt = $db->query($query, array($res_id));
while($res = $stmt->fetchObject()){
......@@ -286,7 +286,7 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module
//USERS
$query = "SELECT u.firstname, u.lastname, u.user_id ";
$query .= "FROM users u, contacts_res cres ";
$query .= "WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (u.user_id as varchar) = cres.contact_id";
$query .= "WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (u.user_id as varchar(128)) = cres.contact_id";
$stmt = $db->query($query, array($res_id));
while($res = $stmt->fetchObject()){
......
......@@ -70,20 +70,19 @@ $statusController = new Maarch_Core_Class_StatusControler();
if ($mode == "up" || $mode == "add") {
$statusArray = array();
$statusArray = $statusController->getAllInfos();
//var_dump($statusArray);
}
function init_session()
{
$_SESSION['m_admin']['action'] = array();
$_SESSION['m_admin']['action']['ID'] = '';
$_SESSION['m_admin']['action']['LABEL'] = '';
$_SESSION['m_admin']['action']['ID_STATUS'] = '';
$_SESSION['m_admin']['action']['ACTION_PAGE'] = '';
$_SESSION['m_admin']['action']['KEYWORD'] = '';
$_SESSION['m_admin']['action']['HISTORY'] = 'Y';
$_SESSION['m_admin']['action']['IS_FOLDER_ACTION'] = 'N';
$_SESSION['m_admin']['action']['categories'] = '';
$_SESSION['m_admin']['action'] = array();
$_SESSION['m_admin']['action']['ID'] = '';
$_SESSION['m_admin']['action']['LABEL'] = '';
$_SESSION['m_admin']['action']['ID_STATUS'] = '';
$_SESSION['m_admin']['action']['ACTION_PAGE'] = '';
$_SESSION['m_admin']['action']['KEYWORD'] = '';
$_SESSION['m_admin']['action']['HISTORY'] = 'Y';
$_SESSION['m_admin']['action']['IS_FOLDER_ACTION'] = 'N';
$_SESSION['m_admin']['action']['categories'] = '';
$_SESSION['m_admin']['action']['categoriesSelected'] = '';
}
......@@ -131,10 +130,10 @@ if (isset($_REQUEST['action_submit'])) {
$_SESSION['m_admin']['action']['IS_FOLDER_ACTION'] =
functions::wash($_REQUEST['is_folder_action'], 'no', _IS_FOLDER_ACTION . ' ');
$_SESSION['m_admin']['action']['order'] = $_REQUEST['order'];
$_SESSION['m_admin']['action']['order'] = $_REQUEST['order'];
$_SESSION['m_admin']['action']['order_field'] = $_REQUEST['order_field'];
$_SESSION['m_admin']['action']['what'] = $_REQUEST['what'];
$_SESSION['m_admin']['action']['start'] = $_REQUEST['start'];
$_SESSION['m_admin']['action']['what'] = $_REQUEST['what'];
$_SESSION['m_admin']['action']['start'] = $_REQUEST['start'];
if ($mode == 'add'
&& ActionControler::actionExists($_SESSION['m_admin']['action']['ID'])
......@@ -168,15 +167,15 @@ if (isset($_REQUEST['action_submit'])) {
}
} else {
$action_value = array(
'id' => $_SESSION['m_admin']['action']['ID'],
'label_action' => $_SESSION['m_admin']['action']['LABEL'],
'keyword' => $_SESSION['m_admin']['action']['KEYWORD'],
'create_id' => $_SESSION['m_admin']['action']['FLAG_CREATE'],
'history' => $_SESSION['m_admin']['action']['HISTORY'],
'id' => $_SESSION['m_admin']['action']['ID'],
'label_action' => $_SESSION['m_admin']['action']['LABEL'],
'keyword' => $_SESSION['m_admin']['action']['KEYWORD'],
'create_id' => $_SESSION['m_admin']['action']['FLAG_CREATE'],
'history' => $_SESSION['m_admin']['action']['HISTORY'],
'is_folder_action' => $_SESSION['m_admin']['action']['IS_FOLDER_ACTION'],
'action_page' => $_SESSION['m_admin']['action']['ACTION_PAGE'],
'id_status' => $_SESSION['m_admin']['action']['ID_STATUS'],
//'category_id' => $_SESSION['m_admin']['action']['CATEGORY_ID']
'action_page' => $_SESSION['m_admin']['action']['ACTION_PAGE'],
'id_status' => $_SESSION['m_admin']['action']['ID_STATUS'],
//'category_id' => $_SESSION['m_admin']['action']['CATEGORY_ID']
);
$action = new Action();
......@@ -192,8 +191,9 @@ if (isset($_REQUEST['action_submit'])) {
ActionControler::razActionPage();
if ($_SESSION['history']['actionadd'] == 'true' && $mode == 'add') {
$db = new Database();
$stmt = $db->query("SELECT id FROM actions ORDER BY id desc limit 1");
$db = new Database();
$query = $db->limit_select(0, 1, "id", "actions", "", "ORDER BY id desc");
$stmt = $db->query($query);
$last_insert = $stmt->fetchObject();
require_once('core/class/class_history.php');
......@@ -295,26 +295,26 @@ if ($mode == 'up') {
if ($tab[$i][$j][$value] == 'id') {
$load = core_tools::is_action_defined($tab[$i][$j]['value']);
$tab[$i][$j]['id'] = $tab[$i][$j]['value'];
$tab[$i][$j]['label'] = _ID;
$tab[$i][$j]['size'] = '10';
$tab[$i][$j]['id'] = $tab[$i][$j]['value'];
$tab[$i][$j]['label'] = _ID;
$tab[$i][$j]['size'] = '10';
$tab[$i][$j]['label_align'] = 'left';
$tab[$i][$j]['align'] = 'left';
$tab[$i][$j]['valign'] = 'bottom';
$tab[$i][$j]['show'] = true;
$tab[$i][$j]['order'] = 'id';
$tab[$i][$j]['align'] = 'left';
$tab[$i][$j]['valign'] = 'bottom';
$tab[$i][$j]['show'] = true;
$tab[$i][$j]['order'] = 'id';
}
if ($tab[$i][$j][$value] == 'label_action') {
$tab[$i][$j]['value'] =
functions::show_string($tab[$i][$j]['value']);
$tab[$i][$j]['label_action'] = $tab[$i][$j]['value'];
$tab[$i][$j]['label'] = _DESC;
$tab[$i][$j]['size'] = '30';
$tab[$i][$j]['label_align'] = 'left';
$tab[$i][$j]['align'] = 'left';
$tab[$i][$j]['valign'] = 'bottom';
$tab[$i][$j]['show'] = true;
$tab[$i][$j]['order'] = 'label_action';
$tab[$i][$j]['label'] = _DESC;
$tab[$i][$j]['size'] = '30';
$tab[$i][$j]['label_align'] = 'left';
$tab[$i][$j]['align'] = 'left';
$tab[$i][$j]['valign'] = 'bottom';
$tab[$i][$j]['show'] = true;
$tab[$i][$j]['order'] = 'label_action';
}
if ($tab[$i][$j][$value] == 'is_system') {
if ($tab[$i][$j]['value'] == 'Y') {
......@@ -330,41 +330,41 @@ if ($mode == 'up') {
'label' => _DESC,'show' => false)
);
}
$tab[$i][$j]['is_system'] = $tab[$i][$j]['value'];
$tab[$i][$j]['label'] =_IS_SYSTEM;
$tab[$i][$j]['size'] = '10';
$tab[$i][$j]['is_system'] = $tab[$i][$j]['value'];
$tab[$i][$j]['label'] =_IS_SYSTEM;
$tab[$i][$j]['size'] = '10';
$tab[$i][$j]['label_align'] = 'left';
$tab[$i][$j]['align'] = 'left';
$tab[$i][$j]['valign'] = 'bottom';
$tab[$i][$j]['show'] = true;
$tab[$i][$j]['order'] = 'is_system';
$tab[$i][$j]['align'] = 'left';
$tab[$i][$j]['valign'] = 'bottom';
$tab[$i][$j]['show'] = true;
$tab[$i][$j]['order'] = 'is_system';
}
if (core_tools::is_module_loaded('folder')) {
if ($tab[$i][$j][$value] == 'is_folder_action') {
($tab[$i][$j]['value'] == 'Y')? $tab[$i][$j]['value'] = _YES : $tab[$i][$j]['value'] = _NO;
$tab[$i][$j]['is_system'] = $tab[$i][$j]['value'];
$tab[$i][$j]['label'] =_IS_FOLDER_ACTION;
$tab[$i][$j]['size'] = '10';
$tab[$i][$j]['is_system'] = $tab[$i][$j]['value'];
$tab[$i][$j]['label'] =_IS_FOLDER_ACTION;
$tab[$i][$j]['size'] = '10';
$tab[$i][$j]['label_align'] = 'left';
$tab[$i][$j]['align'] = 'left';
$tab[$i][$j]['valign'] = 'bottom';
$tab[$i][$j]['show'] = true;
$tab[$i][$j]['order'] = 'is_system';
$tab[$i][$j]['align'] = 'left';
$tab[$i][$j]['valign'] = 'bottom';
$tab[$i][$j]['show'] = true;
$tab[$i][$j]['order'] = 'is_system';
}
}
}
}
}
$page_name = 'action_management_controler&mode=list';
$page_name_up = 'action_management_controler&mode=up';
$page_name = 'action_management_controler&mode=list';
$page_name_up = 'action_management_controler&mode=up';
$page_name_del = 'action_management_controler&mode=del';
$page_name_val= '';
$page_name_val = '';
$page_name_ban = '';
$page_name_add = 'action_management_controler&mode=add';
$label_add = _ADD_ACTION;
$label_add = _ADD_ACTION;
$_SESSION['m_admin']['init'] = true;
$title = _ACTION_LIST . ' : ' . count($tab) . ' ' . _ACTIONS;
$title = _ACTION_LIST . ' : ' . count($tab) . ' ' . _ACTIONS;
$autoCompletionArray = array();
$autoCompletionArray['list_script_url'] =
......
......@@ -58,11 +58,12 @@ if($stmt->rowCount() == 0)
}
else
{
$stmt=$db->query("SELECT coll_id FROM doctypes WHERE type_id = ?", array($s_id));
$stmt = $db->query("SELECT coll_id FROM doctypes WHERE type_id = ?", array($s_id));
$collId = $stmt->fetchObject();
$table = $sec->retrieve_table_from_coll($collId->coll_id);
$table = $sec->retrieve_table_from_coll($collId->coll_id);
$stmt = $db->query("SELECT res_id FROM ". $table ." WHERE type_id = ? limit 1", array($s_id));
$query = $db->limit_select(0, 1, 'res_id', $table, 'type_id = ?');
$stmt = $db->query($query, array($s_id));
if($stmt->rowCount() == 0)
{
......
......@@ -42,7 +42,7 @@ $admin->manage_location_bar($page_path, $page_label, $page_id, $init, $level);
/***********************************************************/
?>
<table width="100%">
<table width="100%" id="controlParamTechnicTable">
<tr>
<td align="left">
<input class="button" type="button" value="<?php echo _CONTROL_PARAM_TECHNIC;
......
<?php
/**
* Copyright Maarch since 2008 under licence GPLv3.
* See LICENCE.txt file at the root folder for more details.
* This file is part of Maarch software.
*
*/
/*Récupération de status*/
require_once 'core/class/class_manage_status.php';
if(file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR."apps".DIRECTORY_SEPARATOR."maarch_entreprise"
......@@ -19,21 +27,8 @@ if ($xmlconfig <> false) {
}
$status_obj = new manage_status();
$db = new Database();
$status_tab = array();
$i=0;
$status_query = "SELECT DISTINCT ON (img_filename) img_filename, id FROM status WHERE img_filename <> '' and img_filename <> 'Y' ";
$stmt = $db->query($status_query);
while ($line = $stmt->fetchObject()) {
array_push(
$status_tab,
array(
'IMG_FILENAME' => $line->img_filename,
'ID' => $line->id
)
);
}
/* Affichage */
if ($mode == 'list') {
$list = new list_show();
......@@ -172,20 +167,20 @@ if ($mode == 'up') {
<ul style=" width: auto;text-align: left;float: left;margin-left: 40px;height: auto;overflow: auto;">
<?php
$nb_status=count($status_img);
for ($i=0;$i<count($status_img);$i++) { ?>
<li style="display:inline-block;width:50px;padding:5px;" title="fm <?php functions::xecho($status_img[$i]);?>" onclick="check_status('<?php functions::xecho($nb_status);?>', '<?php functions::xecho($i);?>')">
<input type="radio" style="visibility:hidden;" id="radio_<?php functions::xecho($i);?>" class="check" name="img_related" value="<?php functions::xecho($status_img[$i])?>"
<?php if ($_SESSION['m_admin']['status']['img_filename'] == $status_img[$i]) { ?> checked="checked" <?php } ?> onload="check_status('<?php functions::xecho($nb_status);?>', '<?php functions::xecho($i);?>')" /><?php
$img = "<label for='".$status_img[$i]."' ><i id='img_".$i."' class = 'fm ".$status_img[$i]."' style='font-size:20px;'></i></label>";
if ($_SESSION['m_admin']['status']['img_filename'] == $status_img[$i]) {
$img = "<label for='".$status_img[$i]."' ><i id='img_".$i."' class = 'fm ".$status_img[$i]."' style='font-size:20px;color:#009dc5;'></i></label>";
}else{
$img = "<label for='".$status_img[$i]."' ><i id='img_".$i."' class = 'fm ".$status_img[$i]."' style='font-size:20px;'></i></label>";
}
for ($i=0;$i<$nb_status;$i++) { ?>
<li style="display:inline-block;width:50px;padding:5px;" title="fm <?php functions::xecho($status_img[$i]);?>" onclick="check_status('<?php functions::xecho($nb_status);?>', '<?php functions::xecho($i);?>')">
<input type="radio" style="visibility:hidden;" id="radio_<?php functions::xecho($i);?>" class="check" name="img_related" value="<?php functions::xecho($status_img[$i])?>"
<?php if ($_SESSION['m_admin']['status']['img_filename'] == $status_img[$i]) { ?> checked="checked" <?php } ?> onload="check_status('<?php functions::xecho($nb_status);?>', '<?php functions::xecho($i);?>')" /><?php
$img = "<label for='".$status_img[$i]."' ><i id='img_".$i."' class = 'fm ".$status_img[$i]."' style='font-size:20px;'></i></label>";
if ($_SESSION['m_admin']['status']['img_filename'] == $status_img[$i]) {
$img = "<label for='".$status_img[$i]."' ><i id='img_".$i."' class = 'fm ".$status_img[$i]."' style='font-size:20px;color:#009dc5;'></i></label>";
}else{
$img = "<label for='".$status_img[$i]."' ><i id='img_".$i."' class = 'fm ".$status_img[$i]."' style='font-size:20px;'></i></label>";
}
echo $img;
echo "</li>";
} ?>
echo $img;
echo "</li>";
} ?>
</ul>
</div>
......
<?php
/**
* Copyright Maarch since 2008 under licence GPLv3.
* See LICENCE.txt file at the root folder for more details.
* This file is part of Maarch software.
*
*/
core_tools::load_lang();
$core_tools = new core_tools();
$core_tools->test_admin('admin_status', 'apps');
......
......@@ -46,7 +46,7 @@ if ($whereSecurityOnEntities == '') {
$db = new Database();
$stmt = $db->query(
"SELECT DISTINCT(users.user_id), CONCAT(users.lastname,' ',users.firstname) as tag FROM users, users_entities "
"SELECT DISTINCT(users.user_id), users.lastname || ' ' || users.firstname as tag FROM users, users_entities "
. " WHERE ("
. "lower(users.lastname) like lower(:what) "
. " or lower(users.user_id) like lower(:what) "
......
......@@ -1046,6 +1046,14 @@ function validate_user_submit()
);
if (isset($_SESSION['m_admin']['users']['groups'])) {
$query = $db->limit_select(0, 1, 'id', 'user_signatures', 'user_id = ? order by id desc ');
$stmt = $db->query($query, array($user->{'user_id'}));
$id_user_signature = $stmt->fetchObject();
if ($id_user_signature && isset($user->{'signature_path'})) {
$db->query('UPDATE user_signatures SET signature_label = ?, signature_path = ?, signature_file_name = ? WHERE user_id = ? and id = ?', ['', $user->{'signature_path'}, $user->{'signature_file_name'}, $user->{'user_id'}, $id_user_signature->id]);
} elseif(isset($user->{'signature_path'})) {
$db->query('INSERT INTO user_signatures (user_id, signature_label, signature_path, signature_file_name) VALUES (?, ?, ?, ?)', [$user->{'user_id'}, '', $user->{'signature_path'}, $user->{'signature_file_name'}]);
}
$control = $uc->save($user, $_SESSION['m_admin']['users']['groups'], $mode, $params);
}
if (!empty($entitiesUserToRedirect)) {
......
......@@ -228,11 +228,11 @@ abstract class chrono_Abstract
{
$db = new Database();
//Get res_id of document
if($res_id==''){
$stmt = $db->query(
"SELECT res_id FROM res_letterbox ORDER BY res_id DESC LIMIT 1"
);
}else{
if ($res_id=='') {
$order = "ORDER by res_id DESC";
$query = $db->limit_select(0, 1, 'res_id', 'res_letterbox', '', '', '', $order);
$stmt = $db->query($query);
} else {
$stmt = $db->query(
"SELECT res_id FROM res_letterbox WHERE res_id=?",
array($res_id)
......
......@@ -3332,11 +3332,26 @@ abstract class lists_Abstract extends Database
!empty($this->params['defaultAction']) &&
$lineIsDisabled === false
) {
$content .= '<td'.$columnStyle.' onmouseover="this.style.cursor=\'pointer\';" '
.'onClick="validForm( \'page\', \''.$keyValue.'\', \''
.$this->params['defaultAction'].'\');" width="'.$resultTheLine[$column]['size'].'%" '
.$class.'><div align="'.$resultTheLine[$column]['align'].'">'
.$columnValue.'</div></td>';
$aService = Basket_Baskets_Service::getServiceFromActionId(['id' => $this->params['defaultAction']]);
if ($aService['actionPage'] == 'visa_mail') {
if (PROD_MODE) {
$content .= '<td'.$columnStyle.' onmouseover="this.style.cursor=\'pointer\';" '
.'onClick="islockForSignatureBook(\'' .$keyValue. '\', \'' .$_SESSION['current_basket']['id']. '\', true);" width="'.$resultTheLine[$column]['size'].'%" '
.$class.'><div align="'.$resultTheLine[$column]['align'].'">'
.$columnValue.'</div></td>';
} else {
$content .= '<td'.$columnStyle.' onmouseover="this.style.cursor=\'pointer\';" '
.'onClick="islockForSignatureBook(\'' .$keyValue. '\', \'' .$_SESSION['current_basket']['id']. '\', false);" width="'.$resultTheLine[$column]['size'].'%" '
.$class.'><div align="'.$resultTheLine[$column]['align'].'">'
.$columnValue.'</div></td>';
}
} else {
$content .= '<td'.$columnStyle.' onmouseover="this.style.cursor=\'pointer\';" '
.'onClick="validForm( \'page\', \''.$keyValue.'\', \''
.$this->params['defaultAction'].'\');" width="'.$resultTheLine[$column]['size'].'%" '
.$class.'><div align="'.$resultTheLine[$column]['align'].'">'
.$columnValue.'</div></td>';
}
} else {
$content .= '<td'.$columnStyle.' width="'.$resultTheLine[$column]['size'].'%" '
.$class.'><div align="'.$resultTheLine[$column]['align'].'">'
......
......@@ -512,18 +512,18 @@ abstract class types_Abstract extends database
$db->query(
"INSERT INTO " . DOCTYPES_TABLE . " (coll_id, "
." description, doctypes_first_level_id, "
. "doctypes_second_level_id, retention_final_disposition, retention_rule, duration_current_use, enabled ) VALUES (?, ?, ?, ?,?,?,? 'Y' )",
. "doctypes_second_level_id, retention_final_disposition, retention_rule, duration_current_use, enabled ) VALUES (?, ?, ?, ?, ?, ?, ?, 'Y')",
array($_SESSION['m_admin']['doctypes']['COLL_ID'], $tmp, $_SESSION['m_admin']['doctypes']['STRUCTURE'], $_SESSION['m_admin']['doctypes']['SUB_FOLDER'],
$_SESSION['m_admin']['doctypes']['RETENTION_FINAL_DISPOSITION'], $_SESSION['m_admin']['doctypes']['RETENTION_RULE'], $_SESSION['m_admin']['doctypes']['DURATION_CURRENT_USE'])
$_SESSION['m_admin']['doctypes']['RETENTION_FINAL_DISPOSITION'], $_SESSION['m_admin']['doctypes']['RETENTION_RULE'], (int)$_SESSION['m_admin']['doctypes']['DURATION_CURRENT_USE'])
);
//$this->show();
$stmt = $db->query(
"SELECT type_id FROM " . DOCTYPES_TABLE
. " WHERE coll_id = ? and description = ? and doctypes_first_level_id = ? and doctypes_second_level_id = ?",
array($_SESSION['m_admin']['doctypes']['COLL_ID'], $tmp, $_SESSION['m_admin']['doctypes']['STRUCTURE']
, $_SESSION['m_admin']['doctypes']['SUB_FOLDER'])
);
//$this->show();
$res = $stmt->fetchObject();
$_SESSION['m_admin']['doctypes']['TYPE_ID'] = $res->type_id;
for ($i = 0; $i < count(
......
.administrationTitle {
background-color: #009DC5 !important;
color: white !important;
margin-top: -10px !important;
margin-left: -15px !important;
margin-right: -15px !important;
padding: 10px !important;
font-size: 20px !important;
text-align:center;
}
.servicesDiv {
margin-top: 1%;
background-color: #CEE9F1;
border-left:solid 1px white;
border-right:solid 1px white;
border-top: solid 2px #FDD16C;
border-bottom: solid 2px #FDD16C;
padding:10px;
}
\ No newline at end of file
......@@ -42,20 +42,22 @@ if(empty($_POST['contact_id']) || $_POST['category'] == 'outgoing'){
//IF EXTERNAL CONTACT
if (is_numeric($_POST['contact_id'])) {
$where = "status <> 'DEL' AND contact_id = ".$_POST['contact_id']." AND address_id = ".$_POST['address_id']." AND creation_date >= (select CURRENT_DATE + integer '-".$_SESSION['check_days_before']."')";
$wherePDO = "status <> 'DEL' AND contact_id = ? AND address_id = ? AND creation_date >= (select CURRENT_DATE + integer '-".$_SESSION['check_days_before']."')";
$where = "status <> 'DEL' AND contact_id = ".$_POST['contact_id']." AND address_id = ".$_POST['address_id']
." AND (creation_date >= " . $db->current_datetime() . " - INTERVAL '".$_SESSION['check_days_before']."' DAY)";
$wherePDO = "status <> 'DEL' AND contact_id = ? AND address_id = ? AND (creation_date >= " . $db->current_datetime() . " - INTERVAL '".$_SESSION['check_days_before']."' DAY)";
$arrayPDO = array($_POST['contact_id'], $_POST['address_id']);
//IF INTERNAL CONTACT
} else {
$where = "status <> 'DEL' AND (exp_user_id = '".$_POST['contact_id']."' OR dest_user_id = '".$_POST['contact_id']."') AND creation_date >= (select CURRENT_DATE + integer '-".$_SESSION['check_days_before']."')";
$wherePDO = "status <> 'DEL' AND (exp_user_id = ? OR dest_user_id = ?) AND creation_date >= (select CURRENT_DATE + integer '-".$_SESSION['check_days_before']."')";
$where = "status <> 'DEL' AND (exp_user_id = '".$_POST['contact_id']."' OR dest_user_id = '".$_POST['contact_id']."') AND (creation_date >= " . $db->current_datetime() . " - INTERVAL '".$_SESSION['check_days_before']."' DAY)";
$wherePDO = "status <> 'DEL' AND (exp_user_id = ? OR dest_user_id = ?) AND (creation_date >= " . $db->current_datetime() . " - INTERVAL '".$_SESSION['check_days_before']."' DAY)";
$arrayPDO = array($_POST['contact_id'], $_POST['contact_id']);
}
//echo $wherePDO;
//MERGE GLOBAL SECURITY WITH QUERY DOC
$wherePDO = $wherePDO . ' AND ('.$whereSec.')';
$query = "SELECT res_id FROM res_view_letterbox WHERE ".$wherePDO;
//$query = "SELECT res_id FROM res_view_letterbox WHERE ".$wherePDO;
//EXCLUDE OWN RES_ID
if($_POST['res_id'] != "none"){
......@@ -65,7 +67,9 @@ if(empty($_POST['contact_id']) || $_POST['category'] == 'outgoing'){
$_SESSION['excludeId'] = $_POST['res_id'];
}
$query .= " ORDER by creation_date DESC limit 1";
$order = "ORDER by creation_date DESC";
$query = $db->limit_select(0, 1, 'res_id', 'res_view_letterbox', $wherePDO, '', '', $order);
$stmt = $db->query($query, $arrayPDO);
if ($stmt->rowCount() > 0){
......
......@@ -276,7 +276,7 @@ if (isset($_POST['put_doc_on_validation'])) {
//Load multicontacts
$query = "SELECT c.contact_firstname, c.contact_lastname, c.firstname, c.lastname, c.society
FROM view_contacts c, contacts_res cres
WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (c.contact_id as varchar) = cres.contact_id AND c.ca_id = cres.address_id
WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (c.contact_id as varchar(128)) = cres.contact_id AND c.ca_id = cres.address_id
GROUP BY c.firstname, c.lastname, c.society, c.contact_firstname, c.contact_lastname";
$stmt = $db->query($query, array($_REQUEST['id']));
......@@ -299,7 +299,7 @@ while ($res = $stmt->fetchObject()) {
}
$query = "SELECT u.firstname, u.lastname, u.user_id ";
$query .= "FROM users u, contacts_res cres ";
$query .= "WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (u.user_id as varchar) = cres.contact_id ";
$query .= "WHERE cres.coll_id = 'letterbox_coll' AND cres.res_id = ? AND cast (u.user_id as varchar(128)) = cres.contact_id ";
$query .= "GROUP BY u.firstname, u.lastname, u.user_id";
$stmt = $db->query($query, array($_REQUEST['id']));
......
......@@ -25,28 +25,34 @@ $list = new lists();
//Include definition fields
require_once 'apps/' . $_SESSION['config']['app_id'] . '/definition_mail_categories.php';
//Keep some parameters
$parameters = '';
$db = new Database();
//URL extra parameters
$urlParameters = '';
$selectQuery = 'ir.record_id as res_id, ir.subject, ir.doc_date, ir.event_date, ir.creation_date, ir.alt_identifier';
$db = new Database();
$tableQuery = "(
WITH summary AS (
SELECT h.record_id, h.event_date, r.subject, r.doc_date, r.creation_date, r.alt_identifier,
ROW_NUMBER() OVER(PARTITION BY h.record_id
ORDER BY h.record_id, h.event_date desc) AS rk
FROM history h, res_view_letterbox r
WHERE h.user_id = ?
AND event_id !='linkup' AND event_id NOT LIKE 'attach%'
AND (h.table_name='res_letterbox' OR h.table_name='res_view_letterbox')
AND h.record_id <> 'none'
AND CAST(h.record_id AS INT) = r.res_id
AND r.status <> 'DEL'
ORDER BY h.record_id, h.event_date desc)
SELECT s.*
FROM summary s
WHERE s.rk = 1) ir";
$whereQuery = '';
$orderQuery = "ORDER BY ir.event_date DESC";
$query = $db->limit_select(0, 5, $selectQuery, $tableQuery, $whereQuery, $orderQuery);
$stmt = $db->query($query, array($_SESSION['user']['UserId']));
$stmt = $db->query(
"SELECT ir.record_id as res_id, ir.subject, ir.doc_date, ir.event_date, ir.creation_date, ir.alt_identifier"
." FROM"
." (SELECT DISTINCT ON (h.record_id) h.record_id, h.event_date, r.subject, r.doc_date, r.creation_date, r.alt_identifier FROM history h, res_view_letterbox r"
." WHERE h.user_id = ?"
." AND event_id !='linkup' AND event_id NOT LIKE 'attach%'"
." AND (h.table_name='res_letterbox' OR h.table_name='res_view_letterbox')"
." AND h.record_id <> 'none'"
." AND CAST(h.record_id AS INT) = r.res_id"
." AND r.status <> 'DEL'"
." ORDER BY h.record_id, h.event_date desc) AS ir"
." ORDER BY ir.event_date desc"
." LIMIT 5", array($_SESSION['user']['UserId'])
);
$i=0;
$j=0;
$x=0;
......
......@@ -242,7 +242,7 @@ if (count($_REQUEST['meta']) > 0) {
elseif ($tab_id_fields[$j] == 'contact_type' && !empty($_REQUEST['contact_type']))
{
$json_txt .= " 'contact_type' : ['".addslashes(trim($_REQUEST['contact_type']))."'],";
$where_request .= " (res_id in (select res_id from contacts_res where contact_id in(select cast (contact_id as varchar) from view_contacts where contact_type = :contactType)) or ";
$where_request .= " (res_id in (select res_id from contacts_res where contact_id in(select cast (contact_id as varchar(128)) from view_contacts where contact_type = :contactType)) or ";
$where_request .= " (contact_id in(select contact_id from view_contacts where contact_type = :contactType))) and ";
$arrayPDO = array_merge($arrayPDO, array(":contactType" => $_REQUEST['contact_type']));
}
......
<?php
/*
* Copyright 2017 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/