diff --git a/back/development.ini.template b/back/development.ini.template index fe7a74ce..318dba2c 100644 --- a/back/development.ini.template +++ b/back/development.ini.template @@ -7,10 +7,10 @@ use = egg:infolica infolica_url_base = http://127.0.0.1:8080/infolica -infolica_mail = -admin_mail = -infolica_smtp = -infolica_balance_mail = +infolica_mail = /*TO COMPLETE*/ +admin_mail = /*TO COMPLETE*/ +infolica_smtp = /*TO COMPLETE*/ +infolica_balance_mail = /*TO COMPLETE*/ pyramid.reload_templates = true pyramid.debug_authorization = false @@ -54,16 +54,6 @@ ldap_login_query_attributes= uid, givenName, sn, mail, telephoneNumber, mobile # Le scope de la recherche (LEVEL, SUBTREE) ldap_login_query_scope= SUBTREE -# L'attribut qui correspond au login d'un utilisateur LDAP -ldap_user_attribute_login= uid - -# Les autres attributs d'un utilisateur LDAP -ldap_user_attribute_firstname= givenName -ldap_user_attribute_lastname= sn -ldap_user_attribute_telephone= telephoneNumber -ldap_user_attribute_mail= mail -ldap_user_attribute_mobile= mobile - ########################################################### # La configuration de la recherche des groupes dans LDAP diff --git a/back/infolica/models/models.py b/back/infolica/models/models.py index 781e5594..57e1f8f2 100644 --- a/back/infolica/models/models.py +++ b/back/infolica/models/models.py @@ -33,7 +33,7 @@ class Operateur(Base): entree = Column(Date, default=datetime.datetime.utcnow, nullable=False) sortie = Column(Date) mail = Column(Text) - + last_notemaj_id = Column(BigInteger) class Cadastre(Base): __tablename__ = 'cadastre' diff --git a/back/infolica/routes.py b/back/infolica/routes.py index 92498370..f5da3220 100644 --- a/back/infolica/routes.py +++ b/back/infolica/routes.py @@ -177,3 +177,4 @@ def includeme(config): #Notes de mise à jour config.add_route('notes_maj', '/infolica/api/notes_maj') config.add_route('version', '/infolica/api/version') + config.add_route('operateur_notes_maj', '/infolica/api/operateur_notes_maj') diff --git a/back/infolica/views/default.py b/back/infolica/views/default.py index 7503a5da..db6d7076 100644 --- a/back/infolica/views/default.py +++ b/back/infolica/views/default.py @@ -68,6 +68,7 @@ def test_error(exc, request): @view_config(route_name='controle_geometre', request_method='OPTIONS', renderer='json') @view_config(route_name='controle_geometre_s', request_method='OPTIONS', renderer='json') @view_config(route_name='save_document', request_method='OPTIONS', renderer='json') +@view_config(route_name='operateur_notes_maj', request_method='OPTIONS', renderer='json') def options_response_view(request): """ Common OPTION RESPONSE diff --git a/back/infolica/views/notes_maj.py b/back/infolica/views/notes_maj.py index 994753b7..d8d992b0 100644 --- a/back/infolica/views/notes_maj.py +++ b/back/infolica/views/notes_maj.py @@ -4,7 +4,7 @@ from infolica.exceptions.custom_error import CustomError from infolica.models.constant import Constant -from infolica.models.models import NotesMAJ +from infolica.models.models import NotesMAJ, Operateur from infolica.scripts.utils import Utils from datetime import date, datetime @@ -19,13 +19,14 @@ def notes_maj_view(request): if not Utils.check_connected(request): raise exc.HTTPForbidden() - active = request.params["active"] if "active" in request.params else "false" - + lastNoteMaj_id = request.params ["lastNoteMaj_id"] if "lastNoteMaj_id" in request.params else None + query = request.dbsession.query(NotesMAJ) - if active == "true": - today = date.today() - query = query.filter(NotesMAJ.delai - today >= 0) + if not lastNoteMaj_id is None: + if lastNoteMaj_id == 'null': + lastNoteMaj_id = 0 + query = query.filter(NotesMAJ.id > lastNoteMaj_id) query = query.order_by(NotesMAJ.id.desc()).all() @@ -39,12 +40,14 @@ def version_view(request): """ model_version = request.dbsession.query(NotesMAJ).order_by(NotesMAJ.version.desc()).first() model_delai = request.dbsession.query(NotesMAJ).order_by(NotesMAJ.delai.desc()).first() + model_lastId = request.dbsession.query(NotesMAJ).order_by(NotesMAJ.id.desc()).first() now = datetime.now() version = { 'version': model_version.version, - 'isNew': datetime.combine(model_delai.delai, datetime.min.time()) >= now + 'isNew': datetime.combine(model_delai.delai, datetime.min.time()) >= now, + 'lastId': model_lastId.id } return version @@ -116,3 +119,28 @@ def notes_maj_delete_view(request): request.dbsession.delete(model) return Utils.get_data_save_response(Constant.SUCCESS_DELETE.format(NotesMAJ.__tablename__)) + + +@view_config(route_name='operateur_notes_maj', request_method='PUT', renderer='json') +def operateur_notes_maj_update_view(request): + """ + Update last seen notes_maj in operateur + """ + # Check authorization + if not Utils.check_connected(request): + raise exc.HTTPForbidden() + + # Get operateur_id + operateur_id = request.params['operateur_id'] if 'operateur_id' in request.params else None + last_notes_maj_id = request.params['last_notes_maj_id'] if 'last_notes_maj_id' in request.params else None + + model = request.dbsession.query(Operateur).filter(Operateur.id == operateur_id).first() + + # If result is empty + if not model: + raise CustomError(CustomError.RECORD_WITH_ID_NOT_FOUND.format(Operateur.__tablename__, operateur_id)) + + # Read params operateur + model.last_notemaj_id = last_notes_maj_id + + return Utils.get_data_save_response(Constant.SUCCESS_SAVE.format(Operateur.__tablename__)) \ No newline at end of file diff --git a/back/production.ini.template b/back/production.ini.template index 4de34318..d38c27b0 100644 --- a/back/production.ini.template +++ b/back/production.ini.template @@ -52,12 +52,6 @@ ldap_login_query_attributes= /*TO COMPLETE*/ # Le scope de la recherche (LEVEL, SUBTREE) ldap_login_query_scope= SUBTREE -# Les autres attributs d'un utilisateur LDAP -ldap_user_attribute_firstname= givenName -ldap_user_attribute_lastname= sn -ldap_user_attribute_telephone= telephoneNumber -ldap_user_attribute_mail= mail - ########################################################### # La configuration de la recherche des groupes dans LDAP @@ -192,7 +186,7 @@ facture_type_facture_id = 1 client_cadastration_id = 2896 # Opérateurs à contacter pour les affaires urgentes -operateur_affaire_urgente = 9,15,21,35,39,45,59,60 +operateur_affaire_urgente = 15,21,57,59,60 ###################################################################################### # Accès dossiers diff --git a/front/.env b/front/.env index 6095dfef..20c4e32f 100644 --- a/front/.env +++ b/front/.env @@ -2,7 +2,7 @@ VUE_APP_API_URL="__url/to/api__" PUBLIC_PATH = "/infolica" -VUE_APP_STATUS = "developpement" +VUE_APP_STATUS = "development" VUE_APP_VERSION = "1.0" #===================================== @@ -88,6 +88,8 @@ VUE_APP_SERVICES_ENDPOINT = "/services/" VUE_APP_FACTURE_ENDPOINT = "/factures/" VUE_APP_EMOLUMENTS_ENDPOINT = "/emoluments" VUE_APP_EMOLUMENTS_FACTURE_ENDPOINT = "/emolument_facture" +VUE_APP_EMOLUMENT_AFFAIRE_ENDPOINT = "/emolument_affaire" +VUE_APP_EMOLUMENT_ENDPOINT = "/emolument" #Etapes de l'affaire VUE_APP_ETAPES_INDEX_ENDPOINT = "/etapes_index/" @@ -161,6 +163,7 @@ VUE_APP_RELPATH_DESIGNATIONS_ENDPOINT = "/A_Administratif/Désignations" #Notes de mise à jour programme VUE_APP_NOTESMAJ_ENDPOINT = "/notes_maj" VUE_APP_VERSION_ENDPOINT = "/version" +VUE_APP_OPERATEUR_LASTNOTEMAJ_ENDPOINT = "/operateur_notes_maj" #===================================== #======== FORMATS DATES ======== diff --git a/front/src/components/Affaires/NumerosAffaire/NumerosAffaire.vue b/front/src/components/Affaires/NumerosAffaire/NumerosAffaire.vue index 76cef8a1..6624b81e 100644 --- a/front/src/components/Affaires/NumerosAffaire/NumerosAffaire.vue +++ b/front/src/components/Affaires/NumerosAffaire/NumerosAffaire.vue @@ -483,6 +483,7 @@ export default { numeros_references_card: [ this.typesAffaires_conf.cadastration, + this.typesAffaires_conf.pcop, this.typesAffaires_conf.ppe, this.typesAffaires_conf.mat_diff, this.typesAffaires_conf.revision_abornement, diff --git a/front/src/components/Header/Header.vue b/front/src/components/Header/Header.vue index 6a2b7877..df57375a 100644 --- a/front/src/components/Header/Header.vue +++ b/front/src/components/Header/Header.vue @@ -81,8 +81,7 @@ export default { */ openNotesMAJ() { this.$root.$emit("openNotesMAJ"); - } - + }, }, mounted: function(){ diff --git a/front/src/components/Login/Login.vue b/front/src/components/Login/Login.vue index 18ce5624..15c8d2de 100644 --- a/front/src/components/Login/Login.vue +++ b/front/src/components/Login/Login.vue @@ -4,7 +4,7 @@ diff --git a/front/src/components/NotesMAJ/notesMAJ.html b/front/src/components/NotesMAJ/notesMAJ.html index 118dfbd6..83153b08 100644 --- a/front/src/components/NotesMAJ/notesMAJ.html +++ b/front/src/components/NotesMAJ/notesMAJ.html @@ -1,10 +1,10 @@ -
La dernière mise à jour comporte les éléments suivants:
+Voici mises à jour apportées depuis votre dernière connexion à Infolica:
Il n'y a pas de mise à jour