# HG changeset patch # User casties # Date 1367575234 -7200 # Node ID b5ff783027d6b392359458f8b002600581c3fabb # Parent fd6931bd49c869ea7b2fd377b18d3410185f066c more work on projects. diff -r fd6931bd49c8 -r b5ff783027d6 MPIWGProjects.py --- a/MPIWGProjects.py Fri May 03 11:30:41 2013 +0200 +++ b/MPIWGProjects.py Fri May 03 12:00:34 2013 +0200 @@ -669,22 +669,33 @@ return items - def addPublication(self, text, RESPONSE=None): + def addPublication(self, text=None, link=None, RESPONSE=None): """add an MPIWG_Publication""" - number = self._getLastPublicationNumber() + 1 - name = "publication_" + str(number) - while hasattr(self, name): - number += 1 + if text or link: + number = self._getLastPublicationNumber() + 1 name = "publication_" + str(number) + while hasattr(self, name): + number += 1 + name = "publication_" + str(number) + + newPublication = MPIWGProject_publication(name) - newPublication = MPIWGProject_publication(name) + self._setObject(name, newPublication) + obj = getattr(self, name) + obj.text = text + obj.link = link + obj.enabled = True; + obj.place = self._getLastPublicationNumber() + 1 + obj.id = name + # hasLinkToBookPage updates bookid if available + if obj.hasLinkToBookPage() and not text: + # take title from book page + try: + book = self.en.books[obj.bookId] + obj.text = book.getInfo('title') + except: + pass - self._setObject(name, newPublication) - obj = getattr(self, name) - obj.text = text[0:] - obj.enabled = True; - obj.place = self._getLastPublicationNumber() + 1 - obj.id = name if RESPONSE is not None: self.redirect(RESPONSE, 'managePublications') diff -r fd6931bd49c8 -r b5ff783027d6 zpt/project/edit_publications.zpt --- a/zpt/project/edit_publications.zpt Fri May 03 11:30:41 2013 +0200 +++ b/zpt/project/edit_publications.zpt Fri May 03 12:00:34 2013 +0200 @@ -26,7 +26,10 @@

Add a project publication

- +

Bibliographical entry:
+ +

+

Link: (optional, can be link to MPIWG book page)

diff -r fd6931bd49c8 -r b5ff783027d6 zpt/project/related_publication/edit_basic.zpt --- a/zpt/project/related_publication/edit_basic.zpt Fri May 03 11:30:41 2013 +0200 +++ b/zpt/project/related_publication/edit_basic.zpt Fri May 03 12:00:34 2013 +0200 @@ -9,11 +9,12 @@

Edit a project publication

-

Bibliographical entry

+

Bibliographical entry:
- -

Link

+

+

Link:
+

Image

Only images of MPIWG book pages are displayed. The link above has to be a link to a MPIWG book page.