Commit a7131e09 authored by Florian Azizian's avatar Florian Azizian

Clean useless code

parent cf06fde9
<?php
/*
* Copyright 2008-2015 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/>.
*/
/**
* Chrono number Class
*
* Contains all the specific functions of chrono number
*
* @package Maarch LetterBox 3.0
* @version 3.0
* @since 06/2007
* @license GPL
*
*/
require_once 'apps/'. $_SESSION['config']['app_id'] .'/class/class_chrono_Abstract.php';
class chrono extends chrono_Abstract
{
// custom
}
This diff is collapsed.
......@@ -17,76 +17,6 @@ abstract class indexing_searching_app_Abstract extends Database
parent::__construct();
}
public function show_index_frame($ext)
{
if (empty($ext)) {
return false;
}
if (file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml')) {
$path = $_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
} else {
$path = 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
}
$xmlconfig = simplexml_load_file($path);
foreach ($xmlconfig->FORMAT as $FORMAT) {
if (strtoupper($ext) == (string) $FORMAT->name) {
if ($FORMAT->canConvert == 'true') {
return true;
} else {
return false;
}
}
}
return false;
}
public function filetypes_showed_indexation()
{
if (file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml')) {
$path = $_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
} else {
$path = 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
}
$xmlconfig = simplexml_load_file($path);
$ext_list = array();
foreach ($xmlconfig->FORMAT as $FORMAT) {
if ((string) $FORMAT->canConvert == 'true') {
array_push($ext_list, (string) $FORMAT->name);
}
}
return $ext_list;
}
public function get_mime_type($ext)
{
if (file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml')) {
$path = $_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
} else {
$path = 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
}
$xmlconfig = simplexml_load_file($path);
$ext_list = array();
$i = 0;
foreach ($xmlconfig->FORMAT as $FORMAT) {
$ext_list[$i] = array('name' => (string) $FORMAT->name, 'mime' => (string) $FORMAT->mime);
++$i;
}
for ($i = 0; $i < count($ext_list); ++$i) {
if ($ext_list[$i]['name'] == strtoupper($ext)) {
$mime_type = $ext_list[$i]['mime'];
$type_state = true;
$i = count($ext_list);
return $mime_type;
break;
}
}
return false;
}
public function send_criteria_data($param)
{
/*list_criteres = Array ("num_courrier" => Array (label => "reference courrier',
......
......@@ -870,210 +870,6 @@ function close_action(id_action, page, path_manage_script, mode_req, res_id_valu
}
/**
* Validates the form of an action
*
* @param current_form_id String Identifier of the form to validate
* @param path_manage_script String Path to the php script called in the Ajax object to validates the form
* @param id_action String Action identifier
* @param values String Action do something on theses items listed in this string
* @param table String Table used for the action
* @param module String Action is this module
* @param coll_id String Collection identifier
* @param mode String Action mode : mass or page
* @param protect_string bool
*/
function valid_action_form(current_form_id, path_manage_script, id_action, values, table, module, coll_id, mode, protect_string, advancedMode) {
var frm_values;
var chosen_action_id;
if (typeof advancedMode !== "undefined") {
frm_values = "so#use#less"; // Sert juste a remplir frm_values pour manage_actions
chosen_action_id = advancedMode[0];
} else {
frm_values = get_form_values(current_form_id);
chosen_action_id = get_chosen_action(current_form_id);
}
if (protect_string != false) {
frm_values = frm_values.replace(/\'/g, "\\'");
frm_values = frm_values.replace(/\"/g, '\\"');
frm_values = frm_values.replace(/\r\n/g, ' ');
frm_values = frm_values.replace(/\r/g, ' ');
frm_values = frm_values.replace(/\n/g, ' ');
}
if (values && table && module && coll_id && chosen_action_id != '') {
new Ajax.Request(path_manage_script, {
method: 'post',
parameters: {
action_id: id_action,
form_to_check: current_form_id,
req: 'valid_form',
form_values: frm_values
},
onCreate: function (answer) {
//show loading image in toolbar
$j("input[type='button']").prop("disabled", true).css("opacity", "0.5");
},
onSuccess: function (answer) {
eval('response=' + answer.responseText);
if (response.status == 0) { //form values checked
var hist = '';
if (chosen_action_id == 'end_action') {
hist = 'Y';
} else {
hist = 'N';
}
if (response.manage_form_now == false) {
pile_actions.action_push("action_send_form_confirm_result( '" + path_manage_script + "', '" + mode + "', '" + id_action + "', '" + values + "','" + table + "', '" + module + "','" + coll_id + "', '" + frm_values + "', '" + hist + "');");
if (chosen_action_id == 'end_action') {
end_actions();
} else {
action_send_first_request(path_manage_script, mode, chosen_action_id, values, table, module, coll_id);
}
} else {
if (chosen_action_id != 'end_action') {
pile_actions.action_push("action_send_first_request( '" + path_manage_script + "', '" + mode + "', '" + chosen_action_id + "', 'to_define','" + table + "', '" + module + "','" + coll_id + "');");
}
action_send_form_confirm_result(path_manage_script, mode, id_action, values, table, module, coll_id, frm_values, hist);
}
} else { // Form Params errors
try {
$('frm_error_' + id_action).innerHTML = response.error_txt;
alert($('frm_error_' + id_action).innerHTML);
$j("input[type='button']").prop("disabled", false).css("opacity", "1");
} catch (e) {
}
}
},
onFailure: function (error) {
console.log(error);
}
});
} else if (chosen_action_id == '') {
alert('Aucune action choisie');
} else {
console.log('Action Error!');
}
}
/**
* Get the chosen action identifier in the form
*
* @param form_id String Identifier of the form
*/
function get_chosen_action(form_id) {
var frm = $(form_id);
for (var i = 0; i < frm.elements.length; i++) {
if (frm.elements[i].id == 'chosen_action') {
if (frm.elements[i].tagName == 'INPUT') {
return frm.elements[i].value;
} else if (frm.elements[i].tagName == 'SELECT') {
return frm.elements[i].options[frm.elements[i].selectedIndex].value;
} else {
break;
}
}
}
return '';
}
/**
* Get the values of the form in an string (Id_field1#field_value1$$Id_field2#field_value2$$)
*
* @param form_id String Identifier of the form
* @return String Values of the form
*/
function get_form_values(form_id, return_string, include_buttons) {
if (typeof (return_string) == "undefined" || return_string === null) {
var in_string = true;
} else {
var in_string = return_string;
}
if (typeof (include_buttons) == "undefined" || include_buttons === null) {
var get_buttons = true;
} else {
var get_buttons = include_buttons;
}
var frm = $(form_id);
if (in_string == true) {
var val = '';
} else {
var val = {};
}
if (frm) {
for (var i = 0; i < frm.elements.length; i++) {
if (frm.elements[i].tagName == 'INPUT' || frm.elements[i].tagName == 'TEXTAREA') {
if ((frm.elements[i].tagName == 'INPUT' && frm.elements[i].type != 'checkbox' && frm.elements[i].type != 'radio') || frm.elements[i].tagName == 'TEXTAREA') {
if ((frm.elements[i].tagName == 'INPUT' && (get_buttons == true || (get_buttons == false && frm.elements[i].type == 'text'))) || frm.elements[i].tagName == 'TEXTAREA') {
if (in_string == true) {
val += frm.elements[i].id + '#' + frm.elements[i].value + '$$';
} else {
val[frm.elements[i].id] = frm.elements[i].value;
}
}
} else {
if (frm.elements[i].checked == true) {
if (in_string == true) {
val += frm.elements[i].id + '#' + frm.elements[i].value + '$$';
} else {
val[frm.elements[i].id] = frm.elements[i].value;
}
}
}
} else if (frm.elements[i].tagName == 'SELECT') {
if (frm.elements[i].type != 'select-multiple') {
if (in_string == true) {
val += frm.elements[i].id + '#' + frm.elements[i].options[frm.elements[i].selectedIndex].value + '$$';
} else {
val[frm.elements[i].id] = frm.elements[i].options[frm.elements[i].selectedIndex].value;
}
} else {
if (in_string == true) {
if (frm.elements[i].selectedOptions) {
val += frm.elements[i].id + '#';
for (var mult = 0; mult < frm.elements[i].selectedOptions.length; mult++) {
if (mult == 0) {
val += frm.elements[i].selectedOptions[mult].value;
} else {
val += '__' + frm.elements[i].selectedOptions[mult].value;
}
}
val += '$$';
}
} else {
var val_s;
for (var mult = 0; mult < frm.elements[i].selectedOptions.length; mult++) {
if (mult == 0) {
val_s += frm.elements[i].selectedOptions[mult].value;
} else {
val_s += '__' + frm.elements[i].selectedOptions[mult].value;
}
}
val[frm.elements[i].id] = val_s;
}
}
}
}
if (in_string == true) {
val.substring(0, val.length - 3);
}
}
return val;
}
/**
* Sends the first ajax request to create a form or resolve a simple action
*
* @param path_manage_script String Path to the php script called in the Ajax object
......@@ -1466,22 +1262,6 @@ function unlock(path_script, id, coll) // A FAIRE
}
}
/**
* Returns in an array all values selected from check boxes or radio buttons
*
* @param name_input String Item Name
* @return Array Checked values
**/
function get_checked_values(name_input) {
var arr = [];
var items = document.getElementsByName(name_input);
for (var i = 0; i < items.length; i++) {
if (items[i].checked == true) {
arr.push(items[i].value);
}
}
return arr;
}
/*************** Apps Reports functions *****************/
......
......@@ -3810,9 +3810,6 @@ if (!defined('_IVS_TOO_MANY_DECIMAL_DIGITS')) {
}
//control technical params
if (!defined('_CONTROL_PARAM_TECHNIC')) {
define('_CONTROL_PARAM_TECHNIC', 'Control technical configurations');
}
if (!defined('_COMPONENT')) {
define('_COMPONENT', 'Component');
}
......
......@@ -3864,9 +3864,6 @@ if (!defined('_IVS_TOO_MANY_DECIMAL_DIGITS')) {
}
//control technical params
if (!defined('_CONTROL_PARAM_TECHNIC')) {
define('_CONTROL_PARAM_TECHNIC', 'Contrôler les paramètres techniques');
}
if (!defined('_COMPONENT')) {
define('_COMPONENT', 'Composant');
}
......@@ -4226,9 +4223,6 @@ if (!defined('_NO_AVAILABLE_TAG_TO_UPDATE')) {
define('_NO_AVAILABLE_TAG_TO_UPDATE', 'Aucune version disponible pour une mise à jour');
}
//PARAMETERS
if (!defined('_ID_IS_EMPTY_CONTROLLER')) {
define('_ID_IS_EMPTY_CONTROLLER', ' L\'identifiant est vide');
}
if (!defined('_PARAM_VALUE_IS_EMPTY')) {
define('_PARAM_VALUE_IS_EMPTY', ' La valeur du paramètre est vide');
}
......
......@@ -1231,7 +1231,6 @@ if (!defined('_IVS_VALUE_NOT_ALLOWED')) { define('_IVS_VALUE_NOT_ALLOWED', 'De w
if (!defined('_IVS_FORMAT_NOT_ALLOWED')) { define('_IVS_FORMAT_NOT_ALLOWED', 'Het formaat is niet toegelaten');}
if (!defined('_IVS_TOO_MANY_DIGITS')) { define('_IVS_TOO_MANY_DIGITS', 'Teveel tekens');}
if (!defined('_IVS_TOO_MANY_DECIMAL_DIGITS')) { define('_IVS_TOO_MANY_DECIMAL_DIGITS', 'Teveel decimale tekens');}
if (!defined('_CONTROL_PARAM_TECHNIC')) { define('_CONTROL_PARAM_TECHNIC', 'De technische instellingen controleren');}
if (!defined('_COMPONENT')) { define('_COMPONENT', 'Component');}
if (!defined('_MARK_AS_READ')) { define('_MARK_AS_READ', 'Markeren als gelezen');}
if (!defined('_MARK_AS_READ_DESC')) { define('_MARK_AS_READ_DESC', 'Markeert het document als gelezen in het bakje. Voegt het gegeven van de res_mark_as_read in de tabel in (nuttig indien gebruikt in de bakjes clauses)');}
......@@ -1345,7 +1344,6 @@ if (!defined('_DEPLOY_VERSION')) { define('_DEPLOY_VERSION', 'De versie unzippen
if (!defined('_UPDATE_END')) { define('_UPDATE_END', 'Update geslaagd');}
if (!defined('_UPDATE_DESC_END')) { define('_UPDATE_DESC_END', 'Update geslaagd');}
if (!defined('_NO_AVAILABLE_TAG_TO_UPDATE')) { define('_NO_AVAILABLE_TAG_TO_UPDATE', 'Geen versie beschikbaar voor update');}
if (!defined('_ID_IS_EMPTY_CONTROLLER')) { define('_ID_IS_EMPTY_CONTROLLER', 'De gebruikersnaam is leeg');}
if (!defined('_PARAM_VALUE_IS_EMPTY')) { define('_PARAM_VALUE_IS_EMPTY', 'De waarde van de instelling is leeg');}
if (!defined('_INVALID_PARAM_DATE')) { define('_INVALID_PARAM_DATE', 'Instelling ongeldige datum');}
if (!defined('_INVALID_INTEGER')) { define('_INVALID_INTEGER', 'Geheel is ongeldig');}
......
<?xml version="1.0" encoding="utf-8"?>
<ROOT>
<MaarchCapture>
<testIt>false</testIt>
<specific>
<pathToMaarchCapture>/opt/maarch/maarch_capture/</pathToMaarchCapture>
</specific>
</MaarchCapture>
<notifications_sendmail>
<testIt>false</testIt>
<specific>
<sendmailTo>dev@maarch.org</sendmailTo>
<sendmailConfPath>/etc/ssmtp/ssmtp.conf</sendmailConfPath>
</specific>
</notifications_sendmail>
</ROOT>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:das="maarch:DataAccessService"
elementFormDefault="qualified"
>
<xsd:annotation>
<xsd:appinfo>
<das:source
name='maarch_entreprise'
type='database'
driver='postgresql'
host='##databaseserver##'
port='##databaseserverport##'
dbname='##databasename##'
user='##databaseuser##'
password='##databasepassword##' />
</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
......@@ -174,10 +174,6 @@ if (!defined('_DISPLAY_ATTACHMENTS')) {
}
/***** Signature Book *****/
if (!defined('_DRAG_N_DROP_CHANGE_ORDER')) {
define('_DRAG_N_DROP_CHANGE_ORDER', 'Drag/Drop to change order');
}
if (!defined('_NO_USER_SIGNED_DOC')) {
define('_NO_USER_SIGNED_DOC', 'you have NOT signed any attachment!');
}
......
......@@ -292,34 +292,10 @@ if (!defined('_PARAMETER')) {
define('_PARAMETER', 'paramètre');
}
if (!defined('_ID_IS_EMPTY_CONTROLLER')) {
define('_ID_IS_EMPTY_CONTROLLER', 'L\'identifiant est vide');
}
if (!defined('_PARAM_CREATED_SUCCESS')) {
define('_PARAM_CREATED_SUCCESS', 'Paramètre créé avec succès');
}
if (!defined('_PARAM_UPDATED_SUCCESS')) {
define('_PARAM_UPDATED_SUCCESS', 'Mise à jour effectuée');
}
if (!defined('_DELETE_CONFIRM')) {
define('_DELETE_CONFIRM', 'Voulez-vous vraiment supprimer le paramètre');
}
if (!defined('_CONTROL_TECHNICAL_PARAMS')) {
define('_CONTROL_TECHNICAL_PARAMS', 'Contrôler les paramètres techniques');
}
if (!defined('_DRAG_N_DROP_CHANGE_ORDER')) {
define('_DRAG_N_DROP_CHANGE_ORDER', 'Glisser/déposer pour modifier l\'ordre du circuit');
}
if (!defined('_DRAG_N_DROP_CHANGE_ORDER')) {
define('_DRAG_N_DROP_CHANGE_ORDER', 'Glisser/déposer pour modifier l\'ordre du circuit');
}
if (!defined('_NO_USER_SIGNED_DOC')) {
define('_NO_USER_SIGNED_DOC', "vous n'avez PAS signé de pièce jointe !");
}
......
......@@ -230,27 +230,9 @@ if (!defined('_PREVIOUS')) {
if (!defined('_PARAMETER')) {
define('_PARAMETER', 'instelling');
}
if (!defined('_ID_IS_EMPTY_CONTROLLER')) {
define('_ID_IS_EMPTY_CONTROLLER', 'De gebruikersnaam is leeg');
}
if (!defined('_PARAM_CREATED_SUCCESS')) {
define('_PARAM_CREATED_SUCCESS', 'Instelling met succes aangemaakt');
}
if (!defined('_PARAM_UPDATED_SUCCESS')) {
define('_PARAM_UPDATED_SUCCESS', 'Update uitgevoerd');
}
if (!defined('_DELETE_CONFIRM')) {
define('_DELETE_CONFIRM', 'Wilt u de instelling echt verwijderen');
}
if (!defined('_CONTROL_TECHNICAL_PARAMS')) {
define('_CONTROL_TECHNICAL_PARAMS', 'De technische instellingen controleren');
}
if (!defined('_DRAG_N_DROP_CHANGE_ORDER')) {
define('_DRAG_N_DROP_CHANGE_ORDER', 'Slepen/neerzetten om de circuitvolgorde te wijzigen');
}
if (!defined('_DRAG_N_DROP_CHANGE_ORDER')) {
define('_DRAG_N_DROP_CHANGE_ORDER', 'Slepen/neerzetten om de circuitvolgorde te wijzigen');
}
if (!defined('_NO_USER_SIGNED_DOC')) {
define('_NO_USER_SIGNED_DOC', 'U heeft de bijlage NIET ondertekend!');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment