Commit 6ef8b13c by Florian Azizian

Merge branch 'develop' into 'master'

Develop

See merge request !62
parents 5cb44924 2ccb606f
......@@ -122,7 +122,7 @@ $_ENV['categories']['incoming']['nature_id'] = array (
'label' => _NATURE,
'table' => 'coll_ext',
'img' => 'envelope',
'modify' => true,
'modify' => false,
'form_show' => 'select'
);
$_ENV['categories']['incoming']['reference_number'] = array (
......@@ -310,7 +310,7 @@ $_ENV['categories']['outgoing']['nature_id'] = array (
'label' => _NATURE,
'table' => 'coll_ext',
'img' => 'envelope',
'modify' => true,
'modify' => false,
'form_show' => 'select'
);
$_ENV['categories']['outgoing']['reference_number'] = array (
......@@ -440,7 +440,7 @@ $_ENV['categories']['internal']['nature_id'] = array (
'label' => _NATURE,
'table' => 'coll_ext',
'img' => 'envelope',
'modify' => true,
'modify' => false,
'form_show' => 'select'
);
$_ENV['categories']['internal']['reference_number'] = array (
......
......@@ -560,22 +560,21 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) )
$pathScriptTab = 'index.php?display=true&page=show_technicalInfo_tab';
$uniqueString .= '<div class="fa fa-cogs DetailsTabFunc" id="DetailsCogdTab" style="font-size:2em;padding-left: 15px;padding-right: 15px;" title="'._TECHNICAL_INFORMATIONS.'" onclick="loadSpecificTab(\'uniqueDetailsIframe\',\''.$pathScriptTab.'\');tabClicked(\'DetailsCogdTab\',true);"><sup><span style="font-size: 10px;display: none;" class="nbResZero"></span></sup></div>';
}
$uniqueString .= '<div class="fa fa-share-alt DetailsTabFunc" id="DetailsGearTab" " style="font-size:2em;padding-left: 15px;';
$uniqueString .= '<div class="DetailsTabFunc" id="DetailsGearTab" " style="font-size:2em;padding-left: 15px;';
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) {
$uniqueString .= 'padding-right: 0px;';
$uniqueString .= 'padding-right: 0px;height:29px;';
}else {
$uniqueString .= 'padding-right: 15px;';
$uniqueString .= 'padding-right: 15px;height:30px;';
}
require_once('modules/entities/class/class_manage_listdiff.php');
$diff_list = new diffusion_list();
$_SESSION['details']['diff_list'] = $diff_list->get_listinstance($s_id, false, $coll_id);
$_SESSION['details']['difflist_type'] = $diff_list->get_difflist_type($_SESSION['details']['diff_list']['difflist_type']);
$roles = $diff_list->list_difflist_roles();
json_encode($roles);
$roles_str = json_encode($roles);
$category = $data['category_id']['value'];
$pathScriptTab = 'index.php?display=true&page=show_diffList_tab&module=entities&resId='.$s_id.'&collId='.$coll_id.'&fromDetail=true&category='.$category.'&roles='.urlencode($roles_str).$onlyCC;
$uniqueString .= '" title="'._DIFF_LIST.'" onclick="loadSpecificTab(\'uniqueDetailsIframe\',\''.$pathScriptTab.'\');tabClicked(\'DetailsGearTab\',true);"> <sup><span style="font-size: 10px;';
$uniqueString .= '" title="'._DIFF_LIST.'" onclick="loadSpecificTab(\'uniqueDetailsIframe\',\''.$pathScriptTab.'\');tabClicked(\'DetailsGearTab\',true);"><i class="fa fa-share-alt" onclick="this.closest(\'div\').click()"></i> <sup><span style="font-size: 10px;';
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) {
$style = 'visibility:hidden;"';
}else {
......@@ -948,8 +947,6 @@ if ((!empty($_SESSION['error']) && ! ($_SESSION['indexation'] )) )
echo 'onchange="change_doctype_details(this.options[this.options.selectedIndex].value, \''.$_SESSION['config']['businessappurl'].'index.php?display=true&dir=indexing_searching&page=change_doctype_details\' , \''._DOCTYPE.' '._MISSING.'\');"';
} else if ($key == 'priority') {
echo 'onchange="updateProcessDate(\'' . $_SESSION['config']['businessappurl'] . 'index.php?display=true&dir=indexing_searching&page=update_process_date\', ' . $s_id . ')"';
} else if ($key == 'nature_id') {
echo 'disabled style="background-color : #e6e6d1;"';
}
?>
>
......
......@@ -153,7 +153,8 @@ if (count($_REQUEST['meta']) > 0) {
$arrayPDO = array_merge($arrayPDO, array(":multifield2" => $multifield));
}
$multifield = \Core\Models\TextFormatModel::normalize(['string' => $multifield]);
$multifield = \Core\Models\TextFormatModel::normalize(['string' => $multifield]);
$multifield = preg_replace('/\s+/', ' ', $multifield);
$arrayPDO = array_merge($arrayPDO, array(":multifield" => "%".$multifield."%"));
$where_request .=" and ";
......@@ -324,7 +325,7 @@ if (count($_REQUEST['meta']) > 0) {
elseif ($tab_id_fields[$j] == 'subject' && !empty($_REQUEST['subject']))
{
$subject = trim($_REQUEST['subject']);
$subject = $func->normalize($subject);
$subject = preg_replace('/\s+/', ' ',$func->normalize($subject));
$json_txt .= " 'subject' : ['".addslashes(trim($subject))."'],";
$where_request .= " (REGEXP_REPLACE(lower(translate(subject,'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ','aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr')),'( ){2,}', ' ') like lower(:subject) "
......@@ -481,7 +482,8 @@ if (count($_REQUEST['meta']) > 0) {
."or res_id in (select res_id_master from res_view_attachments where (lower(translate(identifier,'/','')) like lower(:multifieldWelcome) OR lower(identifier) like lower(:multifieldWelcome)) AND status NOT IN ('DEL','OBS','TMP')) "
."or contact_id in (select contact_id from view_contacts where society ilike :multifieldWelcome or contact_firstname ilike :multifieldWelcome or contact_lastname ilike :multifieldWelcome) or (exp_user_id in (select user_id from users where firstname ilike :multifieldWelcome or lastname ilike :multifieldWelcome )))";
$multifieldWelcome = \Core\Models\TextFormatModel::normalize(['string' => $welcome]);
$multifieldWelcome = \Core\Models\TextFormatModel::normalize(['string' => $welcome]);
$multifieldWelcome = preg_replace('/\s+/', ' ', $multifieldWelcome);
$arrayPDO = array_merge($arrayPDO, array(":multifieldWelcome" => "%".$multifieldWelcome."%"));
set_include_path('apps' . DIRECTORY_SEPARATOR
. $_SESSION['config']['app_id']
......
......@@ -2094,10 +2094,11 @@ $content .= '<iframe src="index.php?display=true&editingMode=true&dir=indexing_s
$content .= '</div>';
if(empty($_REQUEST['id'])){
$js = 'setTimeout(function(){window.parent.document.getElementById(\'liMainDocument\').click()}, 1000)';
$js = 'setTimeout(function(){window.parent.document.getElementById(\'liMainDocument\').click()}, 1000);';
} else {
$js = 'setTimeout(function(){window.top.document.getElementById(\'liAttachement\').click()}, 1000)';
$js = 'setTimeout(function(){window.top.document.getElementById(\'liAttachement\').click()}, 1000);';
}
$js .= "setInterval(function(){window.top.clearTimeout(window.top.chronoExpiration);window.top.chronoExpiration=window.top.setTimeout('redirect_to_url(\'index.php?display=true&page=logout&logout=true\')', ".$_SESSION['config']['cookietime']."*60*1000); }, 60000);";
echo "{status : " . $status . ", content : '" . addslashes(_parse($content)) . "', error : '" . addslashes($error) . "', exec_js : '".addslashes($js)."'}";
exit ();
......@@ -155,6 +155,13 @@ if (! empty($_SESSION['error'])) {
$file = $docserver . $path . $filename;
$file = str_replace("#", DIRECTORY_SEPARATOR, $file);
if (!copy($file, $_SESSION['config']['tmppath'] . DIRECTORY_SEPARATOR . $filename)) {
echo 'error';
exit();
} else {
$file = $_SESSION['config']['tmppath'] . DIRECTORY_SEPARATOR . $filename;
}
if (strtoupper($format) == "MAARCH") {
if (file_exists($file)) {
$myfile = fopen($file, "r");
......
......@@ -45,15 +45,13 @@ abstract class admin_basket_Abstract extends Database
$default_action_list = '';
$db = new Database();
$stmt = $db->query("select gb.group_id, gb.sequence, gb.result_page, gb.list_lock_clause, gb.sublist_lock_clause, u.group_desc from "
$stmt = $db->query("select gb.group_id, gb.result_page, gb.list_lock_clause, gb.sublist_lock_clause, u.group_desc from "
.$_SESSION['tablename']['bask_groupbasket']." gb, ".$_SESSION['tablename']['usergroups']
." u where gb.basket_id = ? and gb.group_id = u.group_id order by u.group_desc",array($id));
while($line2 = $stmt->fetchObject())
{
$stmt2 = $db->query("select agb.group_id, agb.basket_id, agb.id_action, agb.where_clause, ba.label_action, agb.used_in_basketlist as mass, agb.used_in_action_page as page, agb.default_action_list from ".$_SESSION['tablename']['bask_actions_groupbaskets']." agb, ".$_SESSION['tablename']['actions']." ba
where ba.id = agb.id_action and agb.group_id = ? and agb.basket_id = ?",array($line2->group_id,$id) );
//$basketlist = $line2->redirect_basketlist;
//$grouplist = $line2->redirect_grouplist;
$actions = array();
while($res = $stmt2->fetchObject())
......@@ -71,8 +69,7 @@ abstract class admin_basket_Abstract extends Database
$_SESSION['m_admin']['basket']['groups'][$i] = array(
"GROUP_ID" => $line2->group_id ,
"GROUP_LABEL" => functions::show_string($line2->group_desc),
"SEQUENCE" => $line2->sequence,
"RESULT_PAGE" => $line2->result_page,
"RESULT_PAGE" => $line2->result_page,
"LOCK_LIST" => $line2->list_lock_clause,
"LOCK_SUBLIST" => $line2->sublist_lock_clause,
"DEFAULT_ACTION" => $default_action_list,
......@@ -746,8 +743,8 @@ abstract class admin_basket_Abstract extends Database
for($i=0; $i < count($_SESSION['m_admin']['basket']['groups'] ); $i++)
{
// Update groupbasket table
$db->query("INSERT INTO ".$_SESSION['tablename']['bask_groupbasket']." (group_id, basket_id, sequence, result_page, list_lock_clause, sublist_lock_clause)
VALUES (?,?,?,?,?,?)",array($_SESSION['m_admin']['basket']['groups'][$i]['GROUP_ID'],$_SESSION['m_admin']['basket']['basketId'],$_SESSION['m_admin']['basket']['groups'][$i]['SEQUENCE'],$_SESSION['m_admin']['basket']['groups'][$i]['RESULT_PAGE'],$_SESSION['m_admin']['basket']['groups'][$i]['LOCK_LIST'],$_SESSION['m_admin']['basket']['groups'][$i]['LOCK_SUBLIST']));
$db->query("INSERT INTO ".$_SESSION['tablename']['bask_groupbasket']." (group_id, basket_id, result_page, list_lock_clause, sublist_lock_clause)
VALUES (?,?,?,?,?)",array($_SESSION['m_admin']['basket']['groups'][$i]['GROUP_ID'],$_SESSION['m_admin']['basket']['basketId'],$_SESSION['m_admin']['basket']['groups'][$i]['RESULT_PAGE'],$_SESSION['m_admin']['basket']['groups'][$i]['LOCK_LIST'],$_SESSION['m_admin']['basket']['groups'][$i]['LOCK_SUBLIST']));
// Browses the actions array for the current basket - group couple and inserts the action in actions_groupbasket table if needed
for($j=0; $j < count($_SESSION['m_admin']['basket']['groups'][$i]['ACTIONS']); $j++)
......
......@@ -430,24 +430,6 @@ abstract class basket_Abstract extends Database
}
}
if ($ind > -1) {
//if no action on the basket we dont do the request on the groupbasket_difflist_types
if($_SESSION['user']['baskets'][$ind]['default_action'] != '' || $_SESSION['user']['baskets'][$ind]['default_action'] != null){
//selection du type de diffusion
$db = new Database();
$stmt = $db->query(
"select difflist_type_id from groupbasket_difflist_types "
. " where basket_id = ? "
. "and group_id = ? "
. "and action_id = ?",array($basketId,$_SESSION['user']['baskets'][$ind]['group_id'],$_SESSION['user']['baskets'][$ind]['default_action']));
if ($stmt->rowCount() <= 0) {
$_SESSION['current_basket']['difflist_type'] = 'entity_id';
} else {
$res = $stmt->fetchObject();
$_SESSION['current_basket']['difflist_type'] = $res->difflist_type_id;
}
}
$_SESSION['current_basket']['table'] = $_SESSION['user']['baskets'][$ind]['table'];
$_SESSION['current_basket']['view'] = $_SESSION['user']['baskets'][$ind]['view'];
$_SESSION['current_basket']['coll_id'] = $_SESSION['user']['baskets'][$ind]['coll_id'];
......@@ -828,9 +810,7 @@ abstract class basket_Abstract extends Database
$groupId = $res->group_id;
}
$stmt = $db->query(
"select sequence, can_redirect, can_delete, can_insert, "
. "result_page, list_lock_clause, sublist_lock_clause, "
."redirect_basketlist, redirect_grouplist from "
"select result_page, list_lock_clause, sublist_lock_clause from "
. GROUPBASKET_TABLE . " where group_id = ? and basket_id = ?",array($groupId,$basketId));
$res = $stmt->fetchObject();
......@@ -977,9 +957,8 @@ abstract class basket_Abstract extends Database
$primaryGroup = $_SESSION['user']['primarygroup'];
}
$stmt = $db->query(
"select sequence, can_redirect, can_delete, can_insert, "
. "result_page, redirect_basketlist, list_lock_clause, "
."sublist_lock_clause, redirect_grouplist from "
"select result_page, list_lock_clause, "
."sublist_lock_clause from "
. GROUPBASKET_TABLE . " where group_id = ? and basket_id = ? ",array($primaryGroup,$basketId));
$res = $stmt->fetchObject();
......@@ -1009,10 +988,6 @@ abstract class basket_Abstract extends Database
$tab['is_virtual'] = $isVirtual;
$tab['basket_owner'] = $basketOwner;
$tab['redirect_services'] = trim(
stripslashes($res->redirect_basketlist)
);
$tab['redirect_users'] = trim(stripslashes($res->redirect_grouplist));
$tab['abs_basket'] = $absBasket;
$tab['clause'] = $secCtrl->process_security_where_clause(
......
......@@ -83,17 +83,12 @@ else
}
$old_group = "";
$seq = "";
if(isset($_REQUEST['old_group']) && !empty($_REQUEST['old_group']))
{
$old_group = $_REQUEST['old_group'];
}
$stmt = $db->query("select max(sequence) as seq from ".$_SESSION['tablename']['bask_groupbasket']." where group_id = ?",array($groupe));
$line = $stmt->fetchObject();
$seq = $line->seq +1;
$actions = array();
$_SESSION['m_admin']['basket_popup']['actions'] = array();
......@@ -155,8 +150,7 @@ else
$tab = array(
"GROUP_ID" => $groupe,
"GROUP_LABEL" => $res->group_desc,
"SEQUENCE" => $seq,
"RESULT_PAGE" => $respage,
"RESULT_PAGE" => $respage,
"LOCK_LIST" => $list_whrere_clause,
"LOCK_SUBLIST" => $sublist_whrere_clause,
"DEFAULT_ACTION" => $default_action_page,
......
......@@ -990,33 +990,5 @@ abstract class diffusion_list_Abstract extends functions
. " WHERE difflist_type_id = ?",array($difflist_type_id)
);
}
#**************************************************************************
# GROUPBASKET_DIFFLIST_TYPES
# Types of lists available for a given group in basket
#**************************************************************************
# Get list of available list model types for a given groupbasket
public function list_groupbasket_difflist_types(
$group_id,
$basket_id,
$action_id
) {
$types = array();
$db = new Database();
$stmt = $db->query(
"select difflist_type_id from " . ENT_GROUPBASKET_DIFFLIST_TYPES
. " where group_id = ?"
. " and basket_id = ?"
. " and action_id = ?",array($group_id,$basket_id,$action_id)
);
$types = array();
while ($type = $stmt->fetchObject()) {
$types[] = (string) $type->difflist_type_id;
}
return $types;
}
}
......@@ -47,9 +47,3 @@ if (! defined('ENT_GROUPBASKET_REDIRECT')) {
if (! defined('ENT_DIFFLIST_TYPES')) {
define('ENT_DIFFLIST_TYPES', 'difflist_types');
}
if (! defined('ENT_GROUPBASKET_DIFFLIST_TYPES')) {
define('ENT_GROUPBASKET_DIFFLIST_TYPES', 'groupbasket_difflist_types');
}
if (! defined('ENT_GROUPBASKET_DIFFLIST_ROLES')) {
define('ENT_GROUPBASKET_DIFFLIST_ROLES', 'groupbasket_difflist_roles');
}
......@@ -140,33 +140,7 @@ elseif($_SESSION['service_tag'] == 'load_basket_session')
for($cpt=0; $cpt < count($_SESSION['m_admin']['basket']['groups'] ); $cpt++)
{
//$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION'] = array();
$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION']['difflist_types'] = array();
if(!empty($_SESSION['m_admin']['basket']['groups'][$cpt]['DEFAULT_ACTION'] ))
{
$query = "SELECT lmt.difflist_type_id, lmt.difflist_type_label FROM " . ENT_GROUPBASKET_DIFFLIST_TYPES . " gblmt left join " . ENT_DIFFLIST_TYPES
. " lmt on lmt.difflist_type_id = gblmt.difflist_type_id "
. " where basket_id= ? and group_id = ? and action_id = ?";
$stmt = $db->query($query,array(trim($_SESSION['m_admin']['basket']['basketId']),trim($_SESSION['m_admin']['basket']['groups'][$cpt]['GROUP_ID']),$_SESSION['m_admin']['basket']['groups'][$cpt]['DEFAULT_ACTION']));
$difflist_types = array();
while($difflist_type = $stmt->fetchObject()) {
$difflist_types[] = array( 'difflist_type_id' => $difflist_type->difflist_type_id, 'difflist_type_label' => $difflist_type->difflist_type_label);
}
$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION']['difflist_types'] = $difflist_types;
}
for($j=0;$j<count($_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS']);$j++)
{
$query = "SELECT lmt.difflist_type_id, lmt.difflist_type_label FROM " . ENT_GROUPBASKET_DIFFLIST_TYPES . " gblmt left join " . ENT_DIFFLIST_TYPES
. " lmt on lmt.difflist_type_id = gblmt.difflist_type_id "
. " where basket_id= ? and group_id = ? and action_id = ?";
$stmt = $db->query($query,array(trim($_SESSION['m_admin']['basket']['basketId']),trim($_SESSION['m_admin']['basket']['groups'][$cpt]['GROUP_ID']),$_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS'][$j]['ID_ACTION']));
$difflist_types = array();
while($difflist_type = $stmt->fetchObject()) {
$difflist_types[] = array( 'difflist_type_id' => $difflist_type->difflist_type_id, 'difflist_type_label' => $difflist_type->difflist_type_label);
}
$_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS'][$j]['difflist_types'] = $difflist_types;
}
$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION']['difflist_types'] = [];
}
}
elseif($_SESSION['service_tag'] == 'load_basket_db')
......@@ -180,53 +154,5 @@ elseif($_SESSION['service_tag'] == 'load_basket_db')
array_push($indexing_actions,$_SESSION['m_admin']['basket']['all_actions'][$cpt]['ID']);
}
}
for($cpt=0; $cpt < count($_SESSION['m_admin']['basket']['groups'] ); $cpt++)
{
$GroupBasket = $_SESSION['m_admin']['basket']['groups'][$cpt];
if(!empty($GroupBasket['DEFAULT_ACTION']) && in_array($GroupBasket['DEFAULT_ACTION'], $indexing_actions))
{
//$ent->update_redirect_groupbasket_db($_SESSION['m_admin']['basket']['groups'][$cpt]['GROUP_ID'], $_SESSION['m_admin']['basket']['basketId'],$_SESSION['m_admin']['basket']['groups'][$cpt]['DEFAULT_ACTION'],$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION']['difflist_types']);
$stmt = $db->query(
"DELETE FROM " . ENT_GROUPBASKET_DIFFLIST_TYPES
. " where basket_id = ? "
. " and group_id = ? "
. " and action_id = ? ",array(trim($_SESSION['m_admin']['basket']['basketId']),trim($GroupBasket['GROUP_ID']),$GroupBasket['DEFAULT_ACTION']));
for ($k = 0; $k < count($GroupBasket['PARAM_DEFAULT_ACTION']['difflist_types']); $k++) {
$difflist_type = $GroupBasket['PARAM_DEFAULT_ACTION']['difflist_types'][$k];
$stmt = $db->query(
"INSERT INTO " . ENT_GROUPBASKET_DIFFLIST_TYPES
. " (group_id, basket_id, action_id, difflist_type_id) values (?, ?, ?, ?)",array(trim($GroupBasket['GROUP_ID']),trim($_SESSION['m_admin']['basket']['basketId']),$GroupBasket['DEFAULT_ACTION'],$difflist_type['difflist_type_id'])
);
}
}
for($j=0;$j<count($GroupBasket['ACTIONS']);$j++)
{
$GroupBasketAction = $GroupBasket['ACTIONS'][$j];
if(in_array($GroupBasketAction['ID_ACTION'], $indexing_actions)) {
//$ent->update_redirect_groupbasket_db($_SESSION['m_admin']['basket']['groups'][$cpt]['GROUP_ID'], $_SESSION['m_admin']['basket']['basketId'],$_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS'][$j]['ID_ACTION'],$_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS'][$j]['difflist_types']);
$db->query(
"DELETE FROM " . ENT_GROUPBASKET_DIFFLIST_TYPES
. " where basket_id= ? and group_id = ? and action_id = ?",array(trim($_SESSION['m_admin']['basket']['basketId']),trim($GroupBasket['GROUP_ID']),$GroupBasketAction['ID_ACTION']));
if (isset($GroupBasketAction['ID_ACTION']['difflist_types'])) {
for ($k = 0; $k < count($GroupBasketAction['ID_ACTION']['difflist_types']); $k++) {
$difflist_type = $GroupBasketAction['ID_ACTION']['difflist_types'][$k];
$stmt = $db->query(
"INSERT INTO " . ENT_GROUPBASKET_DIFFLIST_TYPES
. " (group_id, basket_id, action_id, difflist_type_id) values (?, ?, ?, ?)",array(trim($GroupBasket['GROUP_ID']),trim($_SESSION['m_admin']['basket']['basketId']),$GroupBasketAction['ID_ACTION'],$difflist_type['difflist_type_id'])
);
}
}
}
}
}
}
else if($_SESSION['service_tag'] == 'del_basket' && !empty($_SESSION['temp_basket_id']))
{
$db = new Database();
$stmt = $db->query("DELETE FROM ".ENT_GROUPBASKET_DIFFLIST_TYPES." WHERE basket_id = ?",array($_SESSION['temp_basket_id']));
unset($_SESSION['temp_basket_id']);
}
?>
......@@ -217,19 +217,7 @@ if ($_SESSION['service_tag'] == 'group_basket') {
$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION']['STATUSES_LIST'] = $array;
}
//ROLES
$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION']['ROLES_LIST'] = array();
if (!empty($_SESSION['m_admin']['basket']['groups'][$cpt]['DEFAULT_ACTION'])) {
$query = "SELECT difflist_role_id FROM " . ENT_GROUPBASKET_DIFFLIST_ROLES
. " where basket_id= ?"
. " and group_id = ?"
. " and action_id = ?";
$stmt = $db->query($query,array(trim($_SESSION['m_admin']['basket']['basketId']),trim($_SESSION['m_admin']['basket']['groups'][$cpt]['GROUP_ID']),$_SESSION['m_admin']['basket']['groups'][$cpt]['DEFAULT_ACTION']));
$array = array();
while ($roles = $stmt->fetchObject()) {
$array[] = array('ID' => $roles->difflist_role_id);
}
$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION']['ROLES_LIST'] = $array;
}
$_SESSION['m_admin']['basket']['groups'][$cpt]['PARAM_DEFAULT_ACTION']['ROLES_LIST'] = [];
//STATUS
for ($j=0;$j<count($_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS']);$j++) {
$query = "SELECT status_id, label_status FROM " . GROUPBASKET_STATUS . " left join " . $_SESSION['tablename']['status']
......@@ -247,16 +235,7 @@ if ($_SESSION['service_tag'] == 'group_basket') {
$j=0;
//ROLES
for ($j=0;$j<count($_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS']);$j++) {
$query = "SELECT difflist_role_id FROM " . ENT_GROUPBASKET_DIFFLIST_ROLES
. " where basket_id= ?"
. " and group_id = ?"
. " and action_id = ?";
$stmt = $db->query($query,array(trim($_SESSION['m_admin']['basket']['basketId']),trim($_SESSION['m_admin']['basket']['groups'][$cpt]['GROUP_ID']),$_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS'][$j]['ID_ACTION']));
$array = array();
while ($roles = $stmt->fetchObject()) {
$array[] = array('ID' => $roles->difflist_role_id);
}
$_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS'][$j]['ROLES_LIST'] = $array;
$_SESSION['m_admin']['basket']['groups'][$cpt]['ACTIONS'][$j]['ROLES_LIST'] = [];
}
}
} elseif ($_SESSION['service_tag'] == 'load_basket_db') {
......@@ -271,15 +250,10 @@ if ($_SESSION['service_tag'] == 'group_basket') {
$GroupBasket = $_SESSION['m_admin']['basket']['groups'][$cpt];
if (!empty($GroupBasket['DEFAULT_ACTION']) && in_array($GroupBasket['DEFAULT_ACTION'], $workflow_actions)) {
//STATUS
$stmt = $db->query(
$db->query(
"DELETE FROM " . GROUPBASKET_STATUS
. " where basket_id= ? and group_id = ? and action_id = ?",array(trim($_SESSION['m_admin']['basket']['basketId']),trim($GroupBasket['GROUP_ID']),$GroupBasket['DEFAULT_ACTION'])
);
//ROLES
$stmt = $db->query(
"DELETE FROM " . ENT_GROUPBASKET_DIFFLIST_ROLES
. " where basket_id= ? and group_id = ? and action_id = ?",array(trim($_SESSION['m_admin']['basket']['basketId']),trim($GroupBasket['GROUP_ID']),$GroupBasket['DEFAULT_ACTION'])
);
//STATUS
for ($k = 0; $k < count($GroupBasket['PARAM_DEFAULT_ACTION']['STATUSES_LIST']); $k++) {
$Status = $GroupBasket['PARAM_DEFAULT_ACTION']['STATUSES_LIST'][$k];
......@@ -290,14 +264,6 @@ if ($_SESSION['service_tag'] == 'group_basket') {
);
}
}
//ROLES
for ($k=0;$k<count($GroupBasket['PARAM_DEFAULT_ACTION']['ROLES_LIST']);$k++) {
$Roles = $GroupBasket['PARAM_DEFAULT_ACTION']['ROLES_LIST'][$k];
$stmt = $db->query(
"INSERT INTO " . ENT_GROUPBASKET_DIFFLIST_ROLES
. " (group_id, basket_id, action_id, difflist_role_id) values (?, ?, ?, ?)",array(trim($GroupBasket['GROUP_ID']),trim($_SESSION['m_admin']['basket']['basketId']),$GroupBasket['DEFAULT_ACTION'],$Roles['ID'])
);
}
}
for ($j=0;$j<count($GroupBasket['ACTIONS']);$j++) {
$GroupBasketAction = $GroupBasket['ACTIONS'][$j];
......@@ -307,11 +273,6 @@ if ($_SESSION['service_tag'] == 'group_basket') {
"DELETE FROM " . GROUPBASKET_STATUS
. " where basket_id= ? and group_id = ? and action_id = ?",array(trim($_SESSION['m_admin']['basket']['basketId']),trim($GroupBasket['GROUP_ID']),$GroupBasketAction['ID_ACTION'])
);
//ROLES
$stmt = $db->query(
"DELETE FROM " . ENT_GROUPBASKET_DIFFLIST_ROLES
. " where basket_id= ? and group_id = ? and action_id = ?",array(trim($_SESSION['m_admin']['basket']['basketId']),trim($GroupBasket['GROUP_ID']),$GroupBasketAction['ID_ACTION'])
);
//STATUS
if (isset($GroupBasketAction['STATUSES_LIST'])) {
for ($k = 0; $k < count($GroupBasketAction['STATUSES_LIST']); $k++) {
......@@ -324,22 +285,11 @@ if ($_SESSION['service_tag'] == 'group_basket') {
}
}
}
//ROLES
if (isset($GroupBasketAction['ROLES_LIST'])) {
for ($k = 0; $k < count($GroupBasketAction['ROLES_LIST']); $k++) {
$Roles = $GroupBasketAction['ROLES_LIST'][$k];
$stmt = $db->query(
"INSERT INTO " . ENT_GROUPBASKET_DIFFLIST_ROLES
. " (group_id, basket_id, action_id, difflist_role_id) values (?, ?, ?, ?)",array(trim($GroupBasket['GROUP_ID']),trim($_SESSION['m_admin']['basket']['basketId']),$GroupBasketAction['ID_ACTION'],$Roles['ID'])
);
}
}
}
}
}
} else if ($_SESSION['service_tag'] == 'del_basket' && !empty($_SESSION['temp_basket_id'])) {
$db = new Database();
$stmt = $db->query("delete from ".GROUPBASKET_STATUS." where basket_id = ?",array($_SESSION['temp_basket_id']));
$stmt = $db->query("delete from ".ENT_GROUPBASKET_DIFFLIST_ROLES." where basket_id = ?",array($_SESSION['temp_basket_id']));
unset($_SESSION['temp_basket_id']);
}
#!/bin/sh
eventStackPath='/var/www/MaarchCourrier/modules/notifications/batch/process_event_stack.php'
cd /var/www/MaarchCourrier/modules/notifications/batch/
php $eventStackPath -c /var/www/MaarchCourrier/modules/notifications/batch/config/config.xml -n NCT
php $eventStackPath -c /var/www/MaarchCourrier/modules/notifications/batch/config/config.xml -n NCC
php $eventStackPath -c /var/www/MaarchCourrier/modules/notifications/batch/config/config.xml -n ANC
php $eventStackPath -c /var/www/MaarchCourrier/modules/notifications/batch/config/config.xml -n AND
......
......@@ -355,3 +355,14 @@ UPDATE res_version_attachments SET in_signature_book = TRUE;
UPDATE listinstance SET signatory = TRUE WHERE item_mode = 'sign';
ALTER TABLE notif_event_stack ALTER COLUMN record_id TYPE character varying(128);
/*BASKETS*/
ALTER TABLE groupbasket DROP COLUMN IF EXISTS sequence;
ALTER TABLE groupbasket DROP COLUMN IF EXISTS redirect_basketlist;
ALTER TABLE groupbasket DROP COLUMN IF EXISTS redirect_grouplist;
ALTER TABLE groupbasket DROP COLUMN IF EXISTS can_redirect;
ALTER TABLE groupbasket DROP COLUMN IF EXISTS can_delete;
ALTER TABLE groupbasket DROP COLUMN IF EXISTS can_insert;
DROP TABLE IF EXISTS groupbasket_difflist_types;
DROP TABLE IF EXISTS groupbasket_difflist_roles;
......@@ -558,13 +558,7 @@ CREATE TABLE groupbasket
(
group_id character varying(32) NOT NULL,
basket_id character varying(32) NOT NULL,
"sequence" integer NOT NULL DEFAULT 0,
redirect_basketlist character varying(2048) DEFAULT NULL::character varying,
redirect_grouplist character varying(2048) DEFAULT NULL::character varying,
result_page character varying(255) DEFAULT 'show_list1.php'::character varying,
can_redirect character(1) NOT NULL DEFAULT 'N'::bpchar,
can_delete character(1) NOT NULL DEFAULT 'N'::bpchar,
can_insert character(1) NOT NULL DEFAULT 'N'::bpchar,
list_lock_clause text,
sublist_lock_clause text,
CONSTRAINT groupbasket_pkey PRIMARY KEY (group_id, basket_id)
......@@ -1989,32 +1983,6 @@ WITH (
OIDS=FALSE
);
CREATE TABLE groupbasket_difflist_types
(
system_id serial NOT NULL,
group_id character varying(32) NOT NULL,
basket_id character varying(32) NOT NULL,
action_id integer NOT NULL,
difflist_type_id character varying(50) NOT NULL,
CONSTRAINT groupbasket_difflist_types_pkey PRIMARY KEY (system_id )
)
WITH (
OIDS=FALSE
);
CREATE TABLE groupbasket_difflist_roles
(
system_id serial NOT NULL,
group_id character varying(32) NOT NULL,
basket_id character varying(32) NOT NULL,
action_id integer NOT NULL,
difflist_role_id character varying(50) NOT NULL,
CONSTRAINT groupbasket_difflist_roles_pkey PRIMARY KEY (system_id)
)
WITH (
OIDS=FALSE
);
CREATE SEQUENCE allowed_ip_id_seq
INCREMENT 1
MINVALUE 1
......
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