[opencourrier-Commits] r954 - in branches/5.0.0: . data/pgsql gen/obj gen/sql/pgsql obj sql/pgsql

0 views
Skip to first unread message

fray...@adullact.net

unread,
Aug 16, 2017, 12:13:56 PM8/16/17
to openmairie-...@googlegroups.com
Author: fraynaud
Date: 2017-08-16 18:13:32 +0200 (Wed, 16 Aug 2017)
New Revision: 954

Modified:
branches/5.0.0/HISTORY.txt
branches/5.0.0/data/pgsql/init_data.sql
branches/5.0.0/data/pgsql/init_metier.sql
branches/5.0.0/data/pgsql/init_metier_trigger.sql
branches/5.0.0/gen/obj/emetteur.class.php
branches/5.0.0/gen/obj/service.class.php
branches/5.0.0/gen/sql/pgsql/emetteur.form.inc.php
branches/5.0.0/gen/sql/pgsql/emetteur.inc.php
branches/5.0.0/gen/sql/pgsql/service.form.inc.php
branches/5.0.0/gen/sql/pgsql/service.inc.php
branches/5.0.0/obj/courrier_arrivee.class.php
branches/5.0.0/obj/utils.class.php
branches/5.0.0/obj/workfonction.class.php
branches/5.0.0/sql/pgsql/courrier.form.inc.php
branches/5.0.0/sql/pgsql/tache.inc.php
Log:

ajout traitement et copie dans courrier



Modified: branches/5.0.0/HISTORY.txt
===================================================================
--- branches/5.0.0/HISTORY.txt 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/HISTORY.txt 2017-08-16 16:13:32 UTC (rev 954)
@@ -12,7 +12,7 @@

* a voir droit d ecriture sous service dans service ?

-* pb de trigger
+* pb de session profil dans changement de fonction-> garde le profil om

apercu dans firefox
-edition

Modified: branches/5.0.0/data/pgsql/init_data.sql
===================================================================
--- branches/5.0.0/data/pgsql/init_data.sql 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/data/pgsql/init_data.sql 2017-08-16 16:13:32 UTC (rev 954)
@@ -11,9 +11,9 @@
INSERT INTO service (service, libelle, servicerattachement, code, email, type_service, mode_diffusion) VALUES (2, 'Direction générale', 1, 'DG', 'd...@ville.fr', 1, 1);
INSERT INTO service (service, libelle, servicerattachement, code, email, type_service, mode_diffusion) VALUES (3, 'Direction ressources humaines', 2, 'DRH', 'd...@ville.fr', 1, 1);
INSERT INTO service (service, libelle, servicerattachement, code, email, type_service, mode_diffusion) VALUES (4, 'Service Paye', 3, 'PAYE', 'pa...@ville.fr', 1, 1);
+update service set en_cours = true;


-
INSERT INTO fonction (fonction, libelle, om_profil, service, om_utilisateur, actif) VALUES (4, 'administrateur opencourrier', 1, 1, 1, false);
INSERT INTO fonction (fonction, libelle, om_profil, service, om_utilisateur, actif) VALUES (6, 'gestionnaire', 4, 1, 1, false);
INSERT INTO fonction (fonction, libelle, om_profil, service, om_utilisateur, actif) VALUES (5, 'gestionnaire', 2, 4, 1, false);

Modified: branches/5.0.0/data/pgsql/init_metier.sql
===================================================================
--- branches/5.0.0/data/pgsql/init_metier.sql 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/data/pgsql/init_metier.sql 2017-08-16 16:13:32 UTC (rev 954)
@@ -153,7 +153,8 @@
emetteurville character varying(40),
tel character varying(13),
type_correspondant integer,
- courriel character varying(100)
+ courriel character varying(100),
+ en_cours boolean
);
CREATE SEQUENCE emetteur_seq
START WITH 1
@@ -190,7 +191,8 @@
service integer NOT NULL,
libelle character varying(100) NOT NULL, -- ***
servicerattachement integer,
- code character varying(15)
+ code character varying(15),
+ en_cours boolean
);
-- ajout des champs permettant la diffusion dematerialisee
alter table service add column email varchar(80);

Modified: branches/5.0.0/data/pgsql/init_metier_trigger.sql
===================================================================
--- branches/5.0.0/data/pgsql/init_metier_trigger.sql 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/data/pgsql/init_metier_trigger.sql 2017-08-16 16:13:32 UTC (rev 954)
@@ -31,14 +31,18 @@
$BODY$
DECLARE
BEGIN
- IF (TG_OP='INSERT' and NEW.coordinates is not null) THEN
- UPDATE tache
- SET geom=ST_Transform(ST_SetSRID(cast(ST_MakePoint(cast(substr(coordinates,1,strpos( coordinates, ',')-1) as float),
- cast(substr(coordinates,strpos( coordinates, ',')+1) as float)) as geometry),4326),2154)
- WHERE tache=NEW.tache;
- RETURN NEW;
- END IF;
- RETURN NEW;
+ IF (TG_OP='INSERT' AND NEW.coordinates IS NOT NULL) THEN
+ NEW.geom=ST_Transform(ST_SetSRID(cast(ST_MakePoint(cast(substr(NEW.coordinates,1,strpos( NEW.coordinates, ',')-1) as float),
+ cast(substr(NEW.coordinates,strpos( NEW.coordinates, ',')+1) as float)) as geometry),4326),2154);
+ ELSEIF(TG_OP='UPDATE') THEN
+ IF (NEW.coordinates is null) THEN
+ NEW.geom=NULL;
+ ELSEIF (OLD.coordinates <> NEW.coordinates OR OLD.coordinates IS NULL) THEN
+ NEW.geom=ST_Transform(ST_SetSRID(cast(ST_MakePoint(cast(substr(NEW.coordinates,1,strpos( NEW.coordinates, ',')-1) as float),
+ cast(substr(NEW.coordinates,strpos( NEW.coordinates, ',')+1) as float)) as geometry),4326),2154);
+ END IF;
+ END IF;
+ RETURN NEW;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
@@ -45,7 +49,7 @@
SET search_path FROM CURRENT;

CREATE TRIGGER tr_maj_tache
- AFTER INSERT OR UPDATE
+ BEFORE INSERT OR UPDATE
ON tache
FOR EACH ROW
EXECUTE PROCEDURE pr_maj_tache();

Modified: branches/5.0.0/gen/obj/emetteur.class.php
===================================================================
--- branches/5.0.0/gen/obj/emetteur.class.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/gen/obj/emetteur.class.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -1,6 +1,6 @@
<?php
//$Id$
-//gen openMairie le 08/08/2017 12:29
+//gen openMairie le 16/08/2017 12:35

require_once "../obj/om_dbform.class.php";

@@ -74,6 +74,11 @@
} else {
$this->valF['courriel'] = $val['courriel'];
}
+ if ($val['en_cours'] == 1 || $val['en_cours'] == "t" || $val['en_cours'] == "Oui") {
+ $this->valF['en_cours'] = true;
+ } else {
+ $this->valF['en_cours'] = false;
+ }
}

//=================================================
@@ -124,6 +129,7 @@
$form->setType("type_correspondant", "select");
}
$form->setType("courriel", "text");
+ $form->setType("en_cours", "checkbox");
}

// MDOE MODIFIER
@@ -147,6 +153,7 @@
$form->setType("type_correspondant", "select");
}
$form->setType("courriel", "text");
+ $form->setType("en_cours", "checkbox");
}

// MODE SUPPRIMER
@@ -162,6 +169,7 @@
$form->setType("tel", "hiddenstatic");
$form->setType("type_correspondant", "selectstatic");
$form->setType("courriel", "hiddenstatic");
+ $form->setType("en_cours", "hiddenstatic");
}

// MODE CONSULTER
@@ -177,6 +185,7 @@
$form->setType("tel", "static");
$form->setType("type_correspondant", "selectstatic");
$form->setType("courriel", "static");
+ $form->setType("en_cours", "checkboxstatic");
}

}
@@ -203,6 +212,7 @@
$form->setTaille("tel", 13);
$form->setTaille("type_correspondant", 11);
$form->setTaille("courriel", 30);
+ $form->setTaille("en_cours", 1);
}

/**
@@ -220,6 +230,7 @@
$form->setMax("tel", 13);
$form->setMax("type_correspondant", 11);
$form->setMax("courriel", 100);
+ $form->setMax("en_cours", 1);
}


@@ -236,6 +247,7 @@
$form->setLib('tel',_('tel'));
$form->setLib('type_correspondant',_('type_correspondant'));
$form->setLib('courriel',_('courriel'));
+ $form->setLib('en_cours',_('en_cours'));
}
/**
*

Modified: branches/5.0.0/gen/obj/service.class.php
===================================================================
--- branches/5.0.0/gen/obj/service.class.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/gen/obj/service.class.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -1,6 +1,6 @@
<?php
//$Id$
-//gen openMairie le 09/08/2017 10:33
+//gen openMairie le 16/08/2017 12:35

require_once "../obj/om_dbform.class.php";

@@ -57,6 +57,11 @@
} else {
$this->valF['mode_diffusion'] = $val['mode_diffusion'];
}
+ if ($val['en_cours'] == 1 || $val['en_cours'] == "t" || $val['en_cours'] == "Oui") {
+ $this->valF['en_cours'] = true;
+ } else {
+ $this->valF['en_cours'] = false;
+ }
}

//=================================================
@@ -107,6 +112,7 @@
} else {
$form->setType("mode_diffusion", "select");
}
+ $form->setType("en_cours", "checkbox");
}

// MDOE MODIFIER
@@ -130,6 +136,7 @@
} else {
$form->setType("mode_diffusion", "select");
}
+ $form->setType("en_cours", "checkbox");
}

// MODE SUPPRIMER
@@ -141,6 +148,7 @@
$form->setType("email", "hiddenstatic");
$form->setType("type_service", "selectstatic");
$form->setType("mode_diffusion", "selectstatic");
+ $form->setType("en_cours", "hiddenstatic");
}

// MODE CONSULTER
@@ -152,6 +160,7 @@
$form->setType("email", "static");
$form->setType("type_service", "selectstatic");
$form->setType("mode_diffusion", "selectstatic");
+ $form->setType("en_cours", "checkboxstatic");
}

}
@@ -175,6 +184,7 @@
$form->setTaille("email", 30);
$form->setTaille("type_service", 11);
$form->setTaille("mode_diffusion", 11);
+ $form->setTaille("en_cours", 1);
}

/**
@@ -188,6 +198,7 @@
$form->setMax("email", 80);
$form->setMax("type_service", 11);
$form->setMax("mode_diffusion", 11);
+ $form->setMax("en_cours", 1);
}


@@ -200,6 +211,7 @@
$form->setLib('email',_('email'));
$form->setLib('type_service',_('type_service'));
$form->setLib('mode_diffusion',_('mode_diffusion'));
+ $form->setLib('en_cours',_('en_cours'));
}
/**
*
@@ -254,6 +266,8 @@
$this->rechercheTable($this->f->db, "categorie_courrier_service", "service", $id);
// Verification de la cle secondaire : categorie_courrier_tache
$this->rechercheTable($this->f->db, "categorie_courrier_tache", "service", $id);
+ // Verification de la cle secondaire : courrier
+ $this->rechercheTable($this->f->db, "courrier", "service_origine", $id);
// Verification de la cle secondaire : diffusion
$this->rechercheTable($this->f->db, "diffusion", "service", $id);
// Verification de la cle secondaire : diffusion
@@ -264,6 +278,8 @@
$this->rechercheTable($this->f->db, "service", "servicerattachement", $id);
// Verification de la cle secondaire : tache
$this->rechercheTable($this->f->db, "tache", "service", $id);
+ // Verification de la cle secondaire : tache
+ $this->rechercheTable($this->f->db, "tache", "service_origine", $id);
}



Modified: branches/5.0.0/gen/sql/pgsql/emetteur.form.inc.php
===================================================================
--- branches/5.0.0/gen/sql/pgsql/emetteur.form.inc.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/gen/sql/pgsql/emetteur.form.inc.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -1,6 +1,6 @@
<?php
//$Id$
-//gen openMairie le 08/08/2017 12:29
+//gen openMairie le 16/08/2017 12:35

$DEBUG=0;
$ent = _("application")." -> "._("emetteur");
@@ -16,7 +16,8 @@
"emetteurville",
"tel",
"type_correspondant",
- "courriel");
+ "courriel",
+ "en_cours");
//champs select
$sql_civilite="SELECT civilite.civilite, civilite.libelle FROM ".DB_PREFIXE."civilite ORDER BY civilite.libelle ASC";
$sql_civilite_by_id = "SELECT civilite.civilite, civilite.libelle FROM ".DB_PREFIXE."civilite WHERE civilite = <idx>";

Modified: branches/5.0.0/gen/sql/pgsql/emetteur.inc.php
===================================================================
--- branches/5.0.0/gen/sql/pgsql/emetteur.inc.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/gen/sql/pgsql/emetteur.inc.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -1,6 +1,6 @@
<?php
//$Id$
-//gen openMairie le 08/08/2017 12:29
+//gen openMairie le 16/08/2017 12:35

$DEBUG=0;
$serie=15;
@@ -51,6 +51,7 @@
'emetteur.tel as "'._("tel").'"',
'type_correspondant.libelle as "'._("type_correspondant").'"',
'emetteur.courriel as "'._("courriel").'"',
+ "case emetteur.en_cours when 't' then 'Oui' else 'Non' end as \""._("en_cours")."\"",
);
//
$champNonAffiche = array(

Modified: branches/5.0.0/gen/sql/pgsql/service.form.inc.php
===================================================================
--- branches/5.0.0/gen/sql/pgsql/service.form.inc.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/gen/sql/pgsql/service.form.inc.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -1,6 +1,6 @@
<?php
//$Id$
-//gen openMairie le 08/08/2017 16:29
+//gen openMairie le 16/08/2017 12:35

$DEBUG=0;
$ent = _("application")." -> "._("service");
@@ -12,7 +12,8 @@
"code",
"email",
"type_service",
- "mode_diffusion");
+ "mode_diffusion",
+ "en_cours");
//champs select
$sql_mode_diffusion="SELECT mode_diffusion.mode_diffusion, mode_diffusion.libelle FROM ".DB_PREFIXE."mode_diffusion ORDER BY mode_diffusion.libelle ASC";
$sql_mode_diffusion_by_id = "SELECT mode_diffusion.mode_diffusion, mode_diffusion.libelle FROM ".DB_PREFIXE."mode_diffusion WHERE mode_diffusion = <idx>";

Modified: branches/5.0.0/gen/sql/pgsql/service.inc.php
===================================================================
--- branches/5.0.0/gen/sql/pgsql/service.inc.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/gen/sql/pgsql/service.inc.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -1,6 +1,6 @@
<?php
//$Id$
-//gen openMairie le 09/08/2017 10:33
+//gen openMairie le 16/08/2017 12:35

$DEBUG=0;
$serie=15;
@@ -49,6 +49,7 @@
'service.email as "'._("email").'"',
'type_service.libelle as "'._("type_service").'"',
'mode_diffusion.libelle as "'._("mode_diffusion").'"',
+ "case service.en_cours when 't' then 'Oui' else 'Non' end as \""._("en_cours")."\"",
);
//
$champNonAffiche = array(
@@ -95,6 +96,7 @@
$sousformulaire = array(
'categorie_courrier_service',
'categorie_courrier_tache',
+ 'courrier',
'diffusion',
'fonction',
'service',

Modified: branches/5.0.0/obj/courrier_arrivee.class.php
===================================================================
--- branches/5.0.0/obj/courrier_arrivee.class.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/obj/courrier_arrivee.class.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -27,6 +27,7 @@
);

var $nature=1;
+ var $maj; // affichage diffusion

function courrier_arrivee($id,&$db,$debug) {
$this->constructeur($id,$db,$debug);
@@ -36,6 +37,12 @@
parent::setType($form,$maj);
$form->setType('nature','selecthiddenstatic');
$form->setType('liaison', 'hidden');
+ if($maj==0){
+ $form->setType('traitement', 'select');
+ $form->setType('copie', 'checkbox_multiple');
+ }else{
+ $form->setType('traitement', 'hidden');
+ }
// Gestion du scan automatique en option dans le config
if($this->validation==0 and $maj==0){ // *** scan ccipa
// affiche pdf ****
@@ -87,12 +94,43 @@
if($maj==0){
$form->setVal('datearrivee', date('Y-m-d'));
$form->setVal('nature', $this->nature);
- $form->setVal("type_courrier",1);
+ $form->setVal("type_courrier",1); // *** voir impossible suppression
}
+ $this->maj=$maj; // affichage diffusion
}// fin validation
}

+ function setSelect(&$form, $maj,&$db,$debug) {
+ parent::setSelect($form, $maj,$db,$debug);
+ if($maj==0){
+ // traitement
+ $sql = "select service, concat(libelle,' - ',code) from ";
+ $sql .= DB_PREFIXE."service ";
+ $sql .= " where service.en_cours is true";
+ $sql .= " ORDER BY service.libelle";
+ $this->init_select($form, $this->f->db, $maj, null, "traitement",
+ $sql, null , false);
+ // copies
+ $this->init_select($form, $this->f->db, $maj, null, "copie",
+ $sql, null , false);
+ $contenu = array();
+ $contenu= array();
+
+ //
+ $res = $db->query($sql);
+ database::isError($res);
+ $k=0;
+ while($row =& $res->fetchRow()){
+ $contenu[0][$k] = $row[0];
+ $contenu[1][$k] = $row[1];
+ $k++;
+ }
+ $form->setSelect("copie", $contenu);
+ }
+ }
+

+
function triggerajouter($id,&$db,$val,$DEBUG) {
parent::triggerajouter($id,$db,$val,$DEBUG);
// Règle d'écriture du registre
@@ -124,7 +162,7 @@
*/
// a faire :repertoire utilisateur
if($val["lib_scan_pdf"]!="") {
- include ("../dyn/var.inc");
+ // include ("../dyn/var.inc");
// fichier requis
require_once($path_fpdf.'fpdf.php');
require_once('../app/pdf/fpdi.php'); // ***
@@ -230,9 +268,25 @@
$this->insert_tache_automatique($this->valF['courrier'],$db,
$val,$row['libelle'], $row['categorie_tache'],$row['service'],
$row['delai'],$row['observation'],$DEBUG);
- }
-
- }
+ }
+ }else{
+ if ($val['traitement']!= null){
+ $this->insert_diffusion_automatique($this->valF['courrier'],$db,
+ $val,$val['traitement'], 1 ,$DEBUG);
+ }else{
+ $this->addToMessage( _("service de traitement obligatoire"));
+ return false;
+ }
+ if ($val['copie']!= null){
+ $temp=explode(";",$val['copie']);
+ foreach ($temp as $service) {
+ $this->insert_diffusion_automatique($this->valF['courrier'],$db,
+ $val, $service , 2 ,$DEBUG);
+ }
+ }else{
+ $this->addToMessage( _("pas de copies saisies"));
+ }
+ }
return true;
}

@@ -259,7 +313,8 @@
$this->addToMessage($diffusion->msg);
return false;
}
- $this->addToMessage( $type_traitement." "._("au service")." : ".$service);
+ $this->addToMessage( _("diffusion")." ".$type_diffusion." ".
+ _("au service")." : ".$service);
return true;

}
@@ -297,8 +352,55 @@
}


+
+
+
+ function setLib(&$form, $maj) {
+ parent::setLib($form, $maj);
+ $form->setLib('datearrivee', _('arrive le').' ');
+ $form->setLib('datecourrier', _('du').' ');
+ $form->setLib('scan_pdf','');
+ $form->setLib('datearrivee', _('arrive').' ');
+ $form->setLib('categorie_courrier',"");
+ $form->setLib('type_correspondant',_('type'));
+ $form->setLib('emetteurad2',_('adresse2'));
+ $form->setLib('emetteurad1',_('adresse1'));
+ $form->setLib('lib_scan_pdf','');
+ $form->setLib('objetcourrier',"");
+ if ($maj==0) {
+ $form->setLib('traitement','');
+ $form->setLib('copie','');
+ }
+ }
+
+
+ function setLayout(&$form, $maj) {
+ // cas maj
+ if ($maj==0 and $this->validation==0){
+ $form->setBloc('scan_pdf','D',"","col_7"); // bloc a gauche
+ $form->setBloc('lib_scan_pdf','F',''); // fin bloc de gauche
+ //courrier
+ $form->setBloc('type_courrier','D',"","col_5"); // bloc droite
+ $form->setFieldset('type_courrier','D',_('TYPE DE COURRIER'), "startClosed");
+ $form->setFieldset('nature','F','');
+ //horodatage
+ $form->setFieldset('datearrivee','D',_('DATE'), "collapsible");
+ $form->setFieldset('datecourrier','F','');
+ //CORRESPONDANT
+ $form->setFieldset('emetteur','D',_('CORRESPONDANT'), "collapsible");
+ $form->setFieldset('ajout_emetteur','F','');
+ //DETAIL
+ $form->setFieldset('categorie_courrier','D',_('TRAITEMENT'), "collapsible");
+ $form->setFieldset('objetcourrier','F','');
+ // COPIE
+ $form->setFieldset('copie','D',_('COPIE(S)'), "collapsible");
+ $form->setFieldset('copie','F','');
+ $form->setBloc('copie','F');
+ }else
+ parent::setLayout($form, $maj); // si pas maj ancienne presentation
+ }
+
// =================================================================
- // *** dematerialisation ***
// affichage et saisie des diffusions copies
// =================================================================

@@ -315,6 +417,7 @@
*/
function afterFormSpecificContent() {
parent::afterFormSpecificContent();
+
if(($this->correct AND $this->validation>0) OR $this->maj>0){
if($this->validation>0 && $this->maj != 2) {
$courrier=$this->valF['courrier'];
@@ -321,9 +424,8 @@
} else {
$courrier=$this->val[array_search('courrier',$this->champs,true)];
}
- echo "<div id=\"affichage_diffusion\" class=\"formEntete ui-corner-all\">";
- echo "a voir";
- //$this->affichediffusion_data($courrier);
+ echo "<div id=\"affichage_diffusion\" class=\"formEntete ui-corner-all\">";
+ $this->affichediffusion_data($courrier);
echo "</div>";
}
}
@@ -341,9 +443,8 @@
*/
function affichediffusion_data($courrier){
// sql
- $sql = "select diffusion.diffusion, servicelib as service, typediffusion, diffusion.typetraitement, ";
- $sql .= " to_char(diffusion.datediffusion ,'DD/MM/YYYY') as "._("datediffusion").", ";
- $sql .= " case diffusion.envoi when 't' then 'Oui' else 'Non' end as \""._("envoi")."\" ";
+ $sql = "select diffusion.diffusion, service.libelle as service, diffusion.type_diffusion, ";
+ $sql .= " to_char(diffusion.datediffusion ,'DD/MM/YYYY') as "._("datediffusion")." ";
$sql .= " from ".DB_PREFIXE."diffusion ";
$sql .= " inner join ".DB_PREFIXE."service on service.service=diffusion.service " ;
$sql .= " where diffusion.courrier = ".$courrier;
@@ -355,19 +456,19 @@
echo "<table class=\"tab-tab\">";
echo "<tr class=\"ui-tabs-nav ui-accordion ui-state-default tab-title\">";
echo "<th class=\"icons\">";
- // En mode ajouter et modifier seulement
- if ($this->maj < 2) {
+ /*
+ // En mode modifier seulement
+ if ($this->maj == 1) {
echo "<a id=\"activator\" href=\"\" onclick=\"getservice(".$courrier
.");return false;\" ><span class=\"om-icon om-icon-16 om-icon-fix add-16\" title=\""
._("diffuser un courrier")."\">"._("diffuser un courrier")."</span></a>";
}
- echo "</th>";
+ echo "</th>";
+ */
echo "<th class=\"title\">"._("diffusion")."</th>";
echo "<th class=\"title\">"._("service")."</th>";
echo "<th class=\"title\">"._("datediffusion")."</th>";
- echo "<th class=\"title\">"._("typediffusion")."</th>";
- echo "<th class=\"title\">"._("typetraitement")."</th>";
- echo "<th class=\"title\">"._("envoi")."</th>";
+ echo "<th class=\"title\">"._("type_diffusion")."</th>";
echo "</tr>";
$i=0;
$oddeven=array("odd","even");
@@ -376,7 +477,7 @@
echo "<td class=\"icons\">";
// Pour ne pas supprimer une diffusion deja envoyé
// pour ne pas supprimer une diffusion en traitement
- if ($this->maj != 3 and $line['envoi']=="Non" and $line['typetraitement']=="copie") {
+ if ($this->maj != 3 and $line['type_diffusion']==2 and $line['datediffusion']==null) {
echo "<a href=\"\" onclick=\"deleteservice(".$line['diffusion'].",".$courrier.");return false;\" ><span class=\"om-icon om-icon-16 om-icon-fix delete-16\" title=\""._("Supprimer le lien")."\">"._("Supprimer le lien")."</span></a>";
}
echo "</td>";
@@ -385,9 +486,7 @@
echo '<td>'.$line_link_content.$line['diffusion'].'</a></td>';
echo '<td>'.$line_link_content.$line['service'].'</a></td>';
echo '<td>'.$line_link_content.$line['datediffusion'].'</a></td>';
- echo '<td>'.$line_link_content.$line['typediffusion'].'</a></td>';
echo '<td>'.$line_link_content.$line['typetraitement'].'</a></td>';
- echo '<td>'.$line_link_content.$line['envoi'].'</a></td>';
echo "</tr>";
$i++;
}
@@ -397,44 +496,7 @@
}


- function setLib(&$form, $maj) {
- parent::setLib($form, $maj);
- $form->setLib('datearrivee', _('arrive le').' ');
- $form->setLib('datecourrier', _('du').' ');
- $form->setLib('scan_pdf','');
- if ($maj==0) {
- $form->setLib('datearrivee', _('arrive').' ');
- $form->setLib('categorie_courrier',_('categorie'));
- $form->setLib('type_correspondant',_('type'));
- $form->setLib('emetteurad2',_('adresse2'));
- $form->setLib('emetteurad1',_('adresse1'));
- $form->setLib('lib_scan_pdf','');
- }
- }

-
- function setLayout(&$form, $maj) {
- // cas maj
- if ($maj==0 and $this->validation==0){
- $form->setBloc('scan_pdf','D',"","col_7"); // bloc a gauche
- $form->setBloc('lib_scan_pdf','F',''); // fin bloc de gauche
- //courrier
- $form->setBloc('type_courrier','D',"","col_5"); // bloc droite
- $form->setFieldset('type_courrier','D',_('TYPE DE COURRIER'), "startClosed");
- $form->setFieldset('nature','F','');
- //horodatage
- $form->setFieldset('datearrivee','D',_('DATE'), "collapsible");
- $form->setFieldset('datecourrier','F','');
- //CORRESPONDANT
- $form->setFieldset('emetteur','D',_('CORRESPONDANT'), "collapsible");
- $form->setFieldset('ajout_emetteur','F','');
- //DETAIL
- $form->setFieldset('categorie_courrier','D',_('DETAIL'), "collapsible");
- $form->setFieldset('objetcourrier','F','');
- $form->setBloc('objetcourrier','F');
- }else
- parent::setLayout($form, $maj); // si pas maj ancienne presentation
- }

}


Modified: branches/5.0.0/obj/utils.class.php
===================================================================
--- branches/5.0.0/obj/utils.class.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/obj/utils.class.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -99,7 +99,8 @@
// Action à ajouter -> affichage de la fonction active
$fonction = array(
"title" => "(".$this->get_fonction_actif().") ".
- $this->get_fonction_libelle($this->get_fonction_actif()),
+ $this->get_fonction_libelle($this->get_fonction_actif()).
+ " ".$_SESSION['profil'],
"description" => _("Fonction(s) de l'utilisateur"),
"class" => "fonction",
);
@@ -126,31 +127,6 @@
$this->addToLog("get_fonction_actif() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
$this->isDatabaseError($fonction);
$_SESSION['fonction']=$fonction;
- /*
- // Requête SQL à la connexion pour changement du profil
- $sql = "SELECT fonction.om_profil
- FROM ".DB_PREFIXE."fonction inner join ".
- DB_PREFIXE."om_utilisateur on fonction.om_utilisateur=om_utilisateur.om_utilisateur ".
- " WHERE actif is true ".
- " and om_utilisateur.login = '".$_SESSION['login']."'";
- $profil = $this->db->getOne($sql);
- $this->addToLog("get_fonction_actif() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
- $this->isDatabaseError($profil);
- if(is_numeric($profil)) // si il y a un profil ou une fonction existante sinon on garde le profil
- $_SESSION['profil']=$profil;
- // Requête SQL à la connexion pour changement de service
- $sql = "SELECT fonction.service
- FROM ".DB_PREFIXE."fonction inner join ".
- DB_PREFIXE."om_utilisateur on fonction.om_utilisateur=om_utilisateur.om_utilisateur ".
- " WHERE actif is true ".
- " and om_utilisateur.login = '".$_SESSION['login']."'";
- $service = $this->db->getOne($sql);
- $this->addToLog("get_fonction_actif() : db->getOne(\"".$sql."\")", VERBOSE_MODE);
- $this->isDatabaseError($service);
- if(is_numeric($service)) // si il y a un profil ou une fonction existante sinon on garde le profil
- $_SESSION['service']=$service;
- */
-
}else
$fonction = $_SESSION['fonction'];
return $fonction;
@@ -164,7 +140,7 @@
if($fonction=="") // evite erreur de requete
$libelle= _("pas de fonction active");
else{
- $sql = "SELECT concat(fonction.libelle,'|', om_profil.om_profil, '|', om_profil.libelle, '|', service.service,'|', service.libelle)";
+ $sql = "SELECT concat(fonction.libelle,'|', om_profil.om_profil, '|', om_profil.libelle, '|', service.service,'|', service.libelle,'|',fonction.om_utilisateur)";
$sql .= " as libelle FROM ".DB_PREFIXE."fonction ";
$sql .= " inner join ".DB_PREFIXE."service ";
$sql .= " on fonction.service = service.service";
@@ -178,7 +154,8 @@
$temp=explode('|', $libelle);
$_SESSION['service'] = $temp[3];
$_SESSION['libservice'] = $temp[4];
- $_SESSION['profil'] = $temp[1];
+ $_SESSION['profil'] = $temp[1];
+ $_SESSION['om_utilisateur'] = $temp[5];
}
}else
$libelle = $_SESSION['libfonction'];
@@ -186,12 +163,46 @@
}


+ /**
+ * SURCHARGE DU PROFIL
+ *
+ * Récupération des informations en base de données de l'utilisateur
+ *
+ * @param string $login Identifiant de l'utilisateur
+ * @return array Informations de l'utilisateur
+ * @access public
+ */
+/*
+ public function retrieveUserProfile($login) {

+ $user_infos = array();

+ //
+ $sql = " SELECT * ";
+ $sql .= " FROM ".DB_PREFIXE.$this->table_om_utilisateur;
+ $sql .= " left join ".DB_PREFIXE.$this->table_om_collectivite;
+ $sql .= " on ".$this->table_om_collectivite.".".$this->table_om_collectivite_field_id." = ".$this->table_om_utilisateur.".".$this->table_om_utilisateur_field_om_collectivite;
+ $sql .= " left join ".DB_PREFIXE.$this->table_om_profil;
+ $sql .= " on ".$this->table_om_utilisateur.".".$this->table_om_utilisateur_field_om_profil." = ".$this->table_om_profil.".".$this->table_om_profil_field_id;
+ $sql .= " WHERE ".$this->table_om_utilisateur.".".$this->table_om_utilisateur_field_login." = '".$login."';";
+ $res = $this->db->query($sql);
+ // Logger
+ $this->addToLog(__METHOD__."(): db->query(\"".$sql."\");", VERBOSE_MODE);
+ //
+ $this->isDatabaseError($res);

+ while ($row =& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
+ $user_infos = $row;
+ }
+ $user_infos["om_profil"]= $_SESSION["profil"];
+ $res ->free();
+ return $user_infos;
+ }

+*/


+
}

?>

Modified: branches/5.0.0/obj/workfonction.class.php
===================================================================
--- branches/5.0.0/obj/workfonction.class.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/obj/workfonction.class.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -46,7 +46,7 @@
$this->f->addToMessage($message_class, $message);
} else {
// recupere le libelle
- $sql = "SELECT concat(fonction.libelle,'|', om_profil.om_profil, '|', om_profil.libelle, '|', service.service,'|', service.libelle)";
+ $sql = "SELECT concat(fonction.libelle,'|', om_profil.om_profil, '|', om_profil.libelle, '|', service.service,'|', service.libelle,'|',fonction.om_utilisateur)";
$sql .= " as libelle FROM ".DB_PREFIXE."fonction ";
$sql .= " inner join ".DB_PREFIXE."service ";
$sql .= " on fonction.service = service.service";
@@ -61,12 +61,15 @@
$temp=explode('|', $libelle);
$_SESSION['service'] = $temp[3];
$_SESSION['libservice'] = $temp[4];
- $_SESSION['profil'] = $temp[1];
+ $_SESSION['profil'] = $temp[1]; // ok mais ne change pas le profil origine
+ $_SESSION['om_utilisateur'] = $temp[5];
+
$message_class = "ok";
$message = _("Vous travaillez maintenant sur la fonction")." (".
$_SESSION['fonction'].") ".$_SESSION['libfonction'].' '.
_("pour utilisateur").' '.$_SESSION['login'];
$this->f->addToMessage($message_class, $message);
+
}
}
}

Modified: branches/5.0.0/sql/pgsql/courrier.form.inc.php
===================================================================
--- branches/5.0.0/sql/pgsql/courrier.form.inc.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/sql/pgsql/courrier.form.inc.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -25,8 +25,9 @@
"type_correspondant",
"'' as ajout_emetteur",
"categorie_courrier",
+ "'' as traitement",
"objetcourrier",
- "'' as traitement",
+ "'' as copie",
"liaison");



Modified: branches/5.0.0/sql/pgsql/tache.inc.php
===================================================================
--- branches/5.0.0/sql/pgsql/tache.inc.php 2017-08-13 15:32:24 UTC (rev 953)
+++ branches/5.0.0/sql/pgsql/tache.inc.php 2017-08-16 16:13:32 UTC (rev 954)
@@ -11,7 +11,21 @@
if ($retourformulaire == 'courrier_depart') {
$selection=" where tache.courrier ='".$idx."'";
}
+// pointe sur 2 fois service
+$table = DB_PREFIXE."tache
+ LEFT JOIN ".DB_PREFIXE."categorie_tache
+ ON tache.categorie_tache=categorie_tache.categorie_tache
+ LEFT JOIN ".DB_PREFIXE."courrier
+ ON tache.courrier=courrier.courrier
+ LEFT JOIN ".DB_PREFIXE."etat_tache
+ ON tache.etat_tache=etat_tache.etat_tache
+ LEFT JOIN ".DB_PREFIXE."service as service
+ ON tache.service=service.service
+ LEFT JOIN ".DB_PREFIXE."service as service2
+ ON tache.service_origine=service2.service ";

+
+
// enleve localisation
$champAffiche = array(
'tache.tache as "'._("tache").'"',

Reply all
Reply to author
Forward
0 new messages