diff --git a/ZAbsences.py b/ZAbsences.py index 94b3b2c85a..6ebf844e0b 100644 --- a/ZAbsences.py +++ b/ZAbsences.py @@ -936,7 +936,7 @@ class ZAbsences( moduleimpl_id = None groups_infos = sco_groups_view.DisplayedGroupsInfos( - self, group_ids, REQUEST=REQUEST + self, group_ids, moduleimpl_id=moduleimpl_id, REQUEST=REQUEST ) if not groups_infos.members: return ( diff --git a/ZScolar.py b/ZScolar.py index 9c23d18936..0e2b356d69 100644 --- a/ZScolar.py +++ b/ZScolar.py @@ -764,14 +764,11 @@ UE11 Découverte métiers (code UCOD46, 16 ECTS, Apo ' % sem) FA.append(groups_infos.get_form_elem()) - + if moduleimpl_id: + FA.append( + '' % moduleimpl_id + ) FA.append('') FA.append( diff --git a/sco_moduleimpl_status.py b/sco_moduleimpl_status.py index e60c642fb9..7a4bf1e782 100644 --- a/sco_moduleimpl_status.py +++ b/sco_moduleimpl_status.py @@ -43,14 +43,13 @@ import sco_formsemestre import sco_formsemestre_status from sco_formsemestre_status import makeMenu import sco_compute_moy - +import ZAbsences # ported from old DTML code in oct 2009 # menu evaluation dans moduleimpl def moduleimpl_evaluation_menu(context, evaluation_id, nbnotes=0, REQUEST=None): "Menu avec actions sur une evaluation" - authuser = REQUEST.AUTHENTICATED_USER E = context.do_evaluation_list({"evaluation_id": evaluation_id})[0] modimpl = context.do_moduleimpl_list(moduleimpl_id=E["moduleimpl_id"])[0] @@ -224,7 +223,6 @@ def moduleimpl_status(context, moduleimpl_id=None, partition_id=None, REQUEST=No ) H.append("") else: - t0, t1 = "règle de calcul standard", "" H.append( 'règle de calcul standard' ) @@ -235,10 +233,21 @@ def moduleimpl_status(context, moduleimpl_id=None, partition_id=None, REQUEST=No ) H.append("") H.append( - 'Absences ' + 'Absences dans ce module' % moduleimpl_id ) - H.append("") + # Adapté à partir d'une suggestion de DS (Le Havre) + # Liens saisies absences seulement si permission et date courante dans le semestre + if authuser.has_permission( + ScoAbsChange, context + ) and sco_formsemestre.sem_est_courant(context, sem): + datelundi = ZAbsences.ddmmyyyy(time.strftime("%d/%m/%Y")).prev_monday() + H.append( + 'Saisie Absences hebdo.' + % (formsemestre_id, moduleimpl_id, datelundi) + ) + + H.append("") # if has_expression and nt.expr_diagnostics: H.append( @@ -478,7 +487,11 @@ def moduleimpl_status(context, moduleimpl_id=None, partition_id=None, REQUEST=No % etat ) if etat["moy"]: - H.append("%s / %g" % (etat["moy"], eval["note_max"])) + H.append("%s / %g" % (etat["moy"], eval["note_max"])) + H.append( + """  (afficher)""" + % (eval["evaluation_id"],) + ) else: H.append( """saisir notes""" @@ -488,7 +501,6 @@ def moduleimpl_status(context, moduleimpl_id=None, partition_id=None, REQUEST=No # if etat["nb_notes"] == 0: H.append(""" """ % tr_class) - # XXX H.append("""""") else: # il y a deja des notes saisies gr_moyennes = etat["gr_moyennes"] @@ -505,7 +517,7 @@ def moduleimpl_status(context, moduleimpl_id=None, partition_id=None, REQUEST=No if gr_moyenne["gr_nb_notes"] > 0: H.append("%(gr_moy)s" % gr_moyenne) H.append( - """  (%s notes""" + """  (%s notes""" % ( eval["evaluation_id"], gr_moyenne["group_id"], diff --git a/sco_pdf.py b/sco_pdf.py index 80f72f9564..23e5c7ff00 100644 --- a/sco_pdf.py +++ b/sco_pdf.py @@ -31,7 +31,10 @@ Tout accès à ReportLab doit donc être précédé d'un PDFLOCK.acquire() et terminé par un PDFLOCK.release() """ -import time, cStringIO +import time +import cStringIO +import re +import os from types import StringType import unicodedata import traceback @@ -49,9 +52,12 @@ from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY from reportlab.lib import styles from reportlab.lib.pagesizes import letter, A4, landscape -from sco_utils import * +import sco_utils as scu +from sco_utils import CONFIG, SCO_ENCODING, SCODOC_LOGOS_DIR, LOGOS_IMAGES_ALLOWED_TYPES from notes_log import log +from sco_exceptions import ScoGenError from SuppressAccents import suppression_diacritics +import VERSION from VERSION import SCOVERSION, SCONAME PAGE_HEIGHT = defaultPageSize[1] @@ -107,7 +113,7 @@ def makeParas(txt, style, suppress_empty=False): if suppress_empty: r = [] for para in paras: - m = re.match("\s*<\s*para.*>\s*(.*)\s*<\s*/\s*para\s*>\s*", para) + m = re.match(r"\s*<\s*para.*>\s*(.*)\s*<\s*/\s*para\s*>\s*", para) if not m: r.append(para) # not a paragraph, keep it else: @@ -229,7 +235,10 @@ class ScolarsPageTemplate(PageTemplate): # ---- Logo: a small image, positionned at top left of the page if self.logo is not None: # draws the logo if it exists - ((width, height), image) = self.logo + ( # pylint: disable=unpacking-non-sequence + (width, height), + image, + ) = self.logo canvas.drawImage(image, inch, doc.pagesize[1] - inch, width, height) # ---- Filigranne (texte en diagonal en haut a gauche de chaque page) @@ -300,7 +309,7 @@ def pdf_basic_page( document.addPageTemplates( ScolarsPageTemplate( document, - context, + context=context, title=title, author="%s %s (E. Viennet)" % (SCONAME, SCOVERSION), footer_template="Edité par %(scodoc_name)s le %(day)s/%(month)s/%(year)s à %(hour)sh%(minute)s", diff --git a/sco_trombino.py b/sco_trombino.py index f1a3385675..04ffb314bc 100644 --- a/sco_trombino.py +++ b/sco_trombino.py @@ -366,7 +366,7 @@ def _trombino_pdf(context, groups_infos, REQUEST): document.addPageTemplates( ScolarsPageTemplate( document, - context, + context=context, preferences=context.get_preferences(sem["formsemestre_id"]), ) ) @@ -515,7 +515,7 @@ def _listeappel_photos_pdf(context, groups_infos, REQUEST): document.addPageTemplates( ScolarsPageTemplate( document, - context, + context=context, preferences=context.get_preferences(sem["formsemestre_id"]), ) ) diff --git a/sco_trombino_tours.py b/sco_trombino_tours.py index 6c0e9556b4..eece74eb09 100644 --- a/sco_trombino_tours.py +++ b/sco_trombino_tours.py @@ -276,7 +276,9 @@ def pdf_trombino_tours( filename = "trombino-%s-%s.pdf" % (DeptName, groups_infos.groups_filename) document = BaseDocTemplate(report) document.addPageTemplates( - ScolarsPageTemplate(document, preferences=context.get_preferences()) + ScolarsPageTemplate( + document, context=context, preferences=context.get_preferences() + ) ) document.build(objects) data = report.getvalue() @@ -468,7 +470,9 @@ def pdf_feuille_releve_absences( else: document = BaseDocTemplate(report, pagesize=taille) document.addPageTemplates( - ScolarsPageTemplate(document, preferences=context.get_preferences()) + ScolarsPageTemplate( + document, context=context, preferences=context.get_preferences() + ) ) document.build(objects) data = report.getvalue() diff --git a/scotests/scointeractive.sh b/scotests/scointeractive.sh index 38bf8dfac7..2cecaf90c2 100755 --- a/scotests/scointeractive.sh +++ b/scotests/scointeractive.sh @@ -17,6 +17,7 @@ usage() { set -euo pipefail cd /opt/scodoc/Products/ScoDoc || exit 2 +source config/config.sh source config/utils.sh if [ $# -lt 1 ] @@ -38,7 +39,11 @@ shift if [ "$recreate_dept" = 1 ] then - (cd config || terminate "no config directory"; ./delete_dept.sh -n "$DEPT") || terminate "error deleting dept $DEPT" + cfg_pathname="${SCODOC_VAR_DIR}/config/depts/$DEPT".cfg + if [ -e "$cfg_pathname" ] + then + (cd config || terminate "no config directory"; ./delete_dept.sh -n "$DEPT") || terminate "error deleting dept $DEPT" + fi (cd config || terminate "no config directory"; ./create_dept.sh -n "$DEPT") || terminate "error creating dept $DEPT" # systemctl start scodoc fi diff --git a/static/css/scodoc.css b/static/css/scodoc.css index 875361b1c8..7eebc65f8b 100644 --- a/static/css/scodoc.css +++ b/static/css/scodoc.css @@ -1223,7 +1223,7 @@ ul.ue_inscr_list li.etud { } #grouplists table { - //border: 1px solid black; + /*border: 1px solid black;*/ border-spacing: 1px; } @@ -1236,7 +1236,9 @@ div.moduleimpl_tableaubord { padding: 7px; border: 2px solid gray; } - +span.moduleimpl_abs_link { + padding-right: 2em; +} .moduleimpl_evaluations_top_links { font-size: 80%; margin-bottom: 3px;