Compare commits
2 Commits
acdda802ab
...
9b9ed47e96
Author | SHA1 | Date | |
---|---|---|---|
9b9ed47e96 | |||
d6b6ab3ea7 |
20
ZAbsences.py
20
ZAbsences.py
@ -697,6 +697,7 @@ class ZAbsences(
|
||||
return int(self.get_preference("work_saturday"))
|
||||
|
||||
security.declareProtected(ScoView, "day_names")
|
||||
|
||||
def day_names(self):
|
||||
"""Returns week day names.
|
||||
If work_saturday property is set, include saturday
|
||||
@ -1993,22 +1994,3 @@ ou entrez une date pour visualiser les absents un jour donné :
|
||||
doc._pop()
|
||||
log("XMLgetAbsEtud (%gs)" % (time.time() - t0))
|
||||
return repr(doc)
|
||||
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
# Zope Product Administration
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
def manage_addZAbsences(
|
||||
self, id="id_ZAbsences", title="The Title for ZAbsences Object", REQUEST=None
|
||||
):
|
||||
"Add a ZAbsences instance to a folder."
|
||||
self._setObject(id, ZAbsences(id, title))
|
||||
if REQUEST is not None:
|
||||
return self.manage_main(self, REQUEST)
|
||||
# return self.manage_editForm(self, REQUEST)
|
||||
|
||||
|
||||
# The form used to get the instance id from the user.
|
||||
# manage_addZAbsencesForm = DTMLFile('dtml/manage_addZAbsencesForm', globals())
|
||||
|
950
ZEntreprises.py
950
ZEntreprises.py
File diff suppressed because it is too large
Load Diff
19
ZNotes.py
19
ZNotes.py
@ -3631,22 +3631,3 @@ class ZNotes(ObjectManager, PropertyManager, RoleManager, Item, Persistent, Impl
|
||||
)
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
#
|
||||
# Zope Product Administration
|
||||
#
|
||||
# --------------------------------------------------------------------
|
||||
def manage_addZNotes(
|
||||
self, id="id_ZNotes", title="The Title for ZNotes Object", REQUEST=None
|
||||
):
|
||||
"Add a ZNotes instance to a folder."
|
||||
self._setObject(id, ZNotes(id, title))
|
||||
if REQUEST is not None:
|
||||
return self.manage_main(self, REQUEST)
|
||||
# return self.manage_editForm(self, REQUEST)
|
||||
|
||||
|
||||
# The form used to get the instance id from the user.
|
||||
manage_addZNotesForm = DTMLFile("dtml/manage_addZNotesForm", globals())
|
||||
|
@ -77,13 +77,7 @@ class ZScoDoc(ObjectManager, PropertyManager, RoleManager, Item, Persistent, Imp
|
||||
manage_options = (
|
||||
({"label": "Contents", "action": "manage_main"},)
|
||||
+ PropertyManager.manage_options # add the 'Properties' tab
|
||||
+ (
|
||||
# this line is kept as an example with the files :
|
||||
# dtml/manage_editZScolarForm.dtml
|
||||
# html/ZScolar-edit.stx
|
||||
# {'label': 'Properties', 'action': 'manage_editForm',},
|
||||
{"label": "View", "action": "index_html"},
|
||||
)
|
||||
+ ({"label": "View", "action": "index_html"},)
|
||||
+ Item.manage_options # add the 'Undo' & 'Owner' tab
|
||||
+ RoleManager.manage_options # add the 'Security' tab
|
||||
)
|
||||
|
14
ZScoUsers.py
14
ZScoUsers.py
@ -105,20 +105,6 @@ class ZScoUsers(
|
||||
self.id = id
|
||||
self.title = title
|
||||
|
||||
# The form used to edit this object
|
||||
# def manage_editZScousers(self, title, RESPONSE=None):
|
||||
# "Changes the instance values"
|
||||
# self.title = title
|
||||
# self._p_changed = 1
|
||||
# RESPONSE.redirect("manage_editForm")
|
||||
|
||||
# Ajout (dans l'instance) d'un dtml modifiable par Zope
|
||||
def defaultDocFile(self, id, title, file):
|
||||
f = open(file_path + "/dtml-editable/" + file + ".dtml")
|
||||
file = f.read()
|
||||
f.close()
|
||||
self.manage_addDTMLMethod(id, title, file)
|
||||
|
||||
# Connexion to SQL database of users:
|
||||
|
||||
# Ugly but necessary during transition out of Zope:
|
||||
|
18
ZScolar.py
18
ZScolar.py
@ -133,13 +133,7 @@ class ZScolar(ObjectManager, PropertyManager, RoleManager, Item, Persistent, Imp
|
||||
manage_options = (
|
||||
({"label": "Contents", "action": "manage_main"},)
|
||||
+ PropertyManager.manage_options # add the 'Properties' tab
|
||||
+ (
|
||||
# this line is kept as an example with the files :
|
||||
# dtml/manage_editZScolarForm.dtml
|
||||
# html/ZScolar-edit.stx
|
||||
# {'label': 'Properties', 'action': 'manage_editForm',},
|
||||
{"label": "View", "action": "index_html"},
|
||||
)
|
||||
+ ({"label": "View", "action": "index_html"},)
|
||||
+ Item.manage_options # add the 'Undo' & 'Owner' tab
|
||||
+ RoleManager.manage_options # add the 'Security' tab
|
||||
)
|
||||
@ -152,17 +146,7 @@ class ZScolar(ObjectManager, PropertyManager, RoleManager, Item, Persistent, Imp
|
||||
self.title = title
|
||||
self._db_cnx_string = db_cnx_string
|
||||
self._cnx = None
|
||||
# --- add editable DTML documents:
|
||||
# self.defaultDocFile('sidebar_dept',
|
||||
# 'barre gauche (partie haute)',
|
||||
# 'sidebar_dept')
|
||||
|
||||
# --- add DB connector
|
||||
# id = 'DB'
|
||||
# da = ZopeDA.Connection(
|
||||
# id, 'DB connector', db_cnx_string, False,
|
||||
# check=1, tilevel=2, encoding='utf-8')
|
||||
# self._setObject(id, da)
|
||||
# --- add Scousers instance
|
||||
id = "Users"
|
||||
obj = ZScoUsers.ZScoUsers(id, "Gestion utilisateurs zope")
|
||||
|
18
__init__.py
18
__init__.py
@ -27,8 +27,6 @@
|
||||
|
||||
from ZScolar import ZScolar, manage_addZScolarForm, manage_addZScolar
|
||||
|
||||
# from ZNotes import ZNotes, manage_addZNotesForm, manage_addZNotes
|
||||
|
||||
from ZScoDoc import ZScoDoc, manage_addZScoDoc
|
||||
|
||||
# from sco_zope import *
|
||||
@ -53,23 +51,7 @@ def initialize(context):
|
||||
icon="static/icons/sco_icon.png",
|
||||
)
|
||||
|
||||
# context.registerHelp()
|
||||
# context.registerHelpTitle("ZScolar")
|
||||
|
||||
# --- ZScoDoc
|
||||
context.registerClass(
|
||||
ZScoDoc, constructors=(manage_addZScoDoc,), icon="static/icons/sco_icon.png"
|
||||
)
|
||||
|
||||
# --- ZNotes
|
||||
# context.registerClass(
|
||||
# ZNotes,
|
||||
# constructors = (
|
||||
# manage_addZNotesForm,
|
||||
# manage_addZNotes
|
||||
# ),
|
||||
# icon = 'static/icons/notes_icon.png'
|
||||
# )
|
||||
|
||||
# context.registerHelp()
|
||||
# context.registerHelpTitle("ZNotes")
|
||||
|
24
notesdb.py
24
notesdb.py
@ -141,6 +141,8 @@ def DBSelectArgs(
|
||||
distinct=True,
|
||||
aux_tables=[],
|
||||
id_name=None,
|
||||
limit="",
|
||||
offset="",
|
||||
):
|
||||
"""Select * from table where values match dict vals.
|
||||
Returns cnx, columns_names, list of tuples
|
||||
@ -155,6 +157,12 @@ def DBSelectArgs(
|
||||
distinct = " distinct "
|
||||
else:
|
||||
distinct = ""
|
||||
if limit != "":
|
||||
limit = " LIMIT %d" % limit
|
||||
if not offset:
|
||||
offset = ""
|
||||
if offset != "":
|
||||
offset = " OFFSET %d" % offset
|
||||
operator = " " + operator + " "
|
||||
# liste des tables (apres "from")
|
||||
tables = [table] + [x[0] for x in aux_tables]
|
||||
@ -195,7 +203,17 @@ def DBSelectArgs(
|
||||
if cond:
|
||||
cond = " where " + cond
|
||||
#
|
||||
req = "select " + distinct + ", ".join(what) + " from " + tables + cond + orderby
|
||||
req = (
|
||||
"select "
|
||||
+ distinct
|
||||
+ ", ".join(what)
|
||||
+ " from "
|
||||
+ tables
|
||||
+ cond
|
||||
+ orderby
|
||||
+ limit
|
||||
+ offset
|
||||
)
|
||||
# open('/tmp/select.log','a').write( req % vals + '\n' )
|
||||
try:
|
||||
cursor.execute(req, vals)
|
||||
@ -329,6 +347,8 @@ class EditableTable:
|
||||
test="=",
|
||||
sortkey=None,
|
||||
disable_formatting=False,
|
||||
limit="",
|
||||
offset="",
|
||||
):
|
||||
"returns list of dicts"
|
||||
# REQLOG.write('%s: %s by %s (%s) %d\n'%(self.table_name,args,sys._getframe(1).f_code.co_name, sys._getframe(2).f_code.co_name, REQN))
|
||||
@ -347,6 +367,8 @@ class EditableTable:
|
||||
operator=operator,
|
||||
aux_tables=self.aux_tables,
|
||||
id_name=self.id_name,
|
||||
limit=limit,
|
||||
offset=offset,
|
||||
)
|
||||
for r in res:
|
||||
self.format_output(r, disable_formatting=disable_formatting)
|
||||
|
@ -2039,7 +2039,14 @@ table.entreprise_list, table.corr_list, table.contact_list {
|
||||
/* border-style: solid; */
|
||||
border-spacing: 0px 0px;
|
||||
padding: 0px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
table.entreprise_list td.nbcorr a, table.entreprise_list td.nbcontact a, table.contact_list td.etudnom a, table.contact_list td a {
|
||||
color: navy;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
tr.entreprise_list_even, tr.corr_list_even, tr.contact_list_even {
|
||||
background-color: rgb(85%,85%,95%);
|
||||
}
|
||||
@ -2047,6 +2054,19 @@ tr.entreprise_list_odd, tr.corr_list_odd, tr.contact_list_odd {
|
||||
background-color: rgb(90%,90%, 90%);
|
||||
}
|
||||
|
||||
span.table_nav_mid {
|
||||
flex-grow: 1; /* Set the middle element to grow and stretch */
|
||||
}
|
||||
span.table_nav_prev, span.table_nav_next {
|
||||
width: 11em; /* A fixed width as the default */
|
||||
}
|
||||
|
||||
div.table_nav {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
td.entreprise_descr, td.corr_descr, td.contact_descr {
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user