Index: openacs-4/packages/contacts/catalog/contacts.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/catalog/contacts.de_DE.ISO-8859-1.xml,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/catalog/contacts.de_DE.ISO-8859-1.xml 24 Feb 2005 13:33:06 -0000 1.2 +++ openacs-4/packages/contacts/catalog/contacts.de_DE.ISO-8859-1.xml 30 Nov 2005 15:31:01 -0000 1.2.2.1 @@ -1,42 +1,519 @@ - + + -- eine Gruppe markieren -- + -- Neue Nachricht erstellen -- + -- Keine -- + -- Bitte ausw�hlen -- Aktion - Person hinzuf�gen - Organisation hinzuf�gen - Ausgew�hlte Kontakte einer Kategorie hinzuf�gen - Einer Kategorie hinzuf�gen + Aktionen + Hinzuf�gen: + Hinzuf�gen + Eine Gruppe hinzuf�gen + Eine Person hinzuf�gen + Eine Organisation hinzuf�gen + Einen Kommentar hinzuf�gen + Eine Beschwerde hinzuf�gen f�r + Bedingung hinzuf�gen + e-Mail Nachricht hinzuf�gen + Gruppe hinzuf�gen + Brief hinzuf�gen + Nachricht hinzuf�gen + Neuen hinzuf�gen + Eine neue %object_type% Gruppen zuteilen + Neuer Kunde + Neuer Kundenkontakt + Suche hinzuf�gen + Eine Signatur hinzuf�gen + Den ausgew�hlten Kontakt zu einer Kategorie hinzuweisen + Zu einer Kategorie zuweisen + Zur Gruppe hinzuf�gen + Zur Gruppe hinzuf�gen + Zu folgenden Gruppen hinzuf�gen + User hinzuf�gen + Adresse + Verwaltung + Kontakte verwalten + Expertensuche + Erweiterte Suchen + Zusammenfassen + Zusammenfassen nach + zusammengefasst nach: Alle + Daten �ndern + Alle Kontakte + und Antwort - Archivieren - Markierten Kontakt archivieren + jede/r + Archiv + Die markierten Kontakte archivieren Archiviert + Gebietsschl�ssel ist -> + Gebietsschl�ssel ist nicht -> + Art der Beziehung + Angeh�ngte Dateien: + um Attribut + Attribut -&gt; Attribute - Zurzeit ausgew�hlte Kategorie leeren - Die ausgew�hlte Suche leeren + Verf�gbare Attribute + Verf�gbare Optionen + Geh�rt zu + Haupttext + Massen Update + Abbrechen + Eine Kopie an mehrere Empf�nger E-Mails getrennt durch ";" versenden. + Ge�ndertes Datum: + �nderungen + Ausw�hlen/Entfernen + Leeren + Die zurzeit markierte Kategorie l�schen + Den zurzeit markierte Suche l�schen + Hinzugef�gter Kommentar + Kommentare + Beschwerde + Umfangreiche Beschreibung der Beschwerde, besonders warum die Beschwerde eingereicht wurde. + Wie viel wurde an den Lieferanten gezahlt + Rabatt in Prozent, der aufgrund einer Beschwerde gegeben werden musste + Betrag der an den Kunden zur�ck gezahlt wurde + Was ist der Status der Beschwerde + Kurze Bezeichnung, um die Beschwerde zu identifizieren + Umsatz, der mit dem Kunden im Bezug auf diese Beschwerde gemacht wurde + Beschwerden/Reklamationen: + KOnfigurationsfehler Kontakt + Kontakt -&gt; + Kontakt ist in -> + Kontakt ist nicht in -> + Kontakt Beziehung Kontakttyp - Jetzige - e-mail Adresse + Kontakttyp eins + Kontakttyp zwei + Kontakte + Kontakte + enth�lt -&gt; + Kopieren + Land + Landeskennziffer ist -> + Land ist -> + Land ist nicht -> + Erzeugen + Eine Nachricht anlegen + Eine Rolle anlegen + Eine Signatur erstellen + F�r diesen User einen User Account erzeugen + e-Mail anlegen + Einen Brief anlegen + Neues Projekt anlegen + Rolle anlegen + User anlegen + CSV + Derzeitig + Kunde: + Kunde hat keine Angestellten + Datum + Tage + L�schen + L�schen + Beschreibung: + Eine kurze Beschreibung, was die (Unter)Abfrage macht + Details + enth�lt nicht -&gt; + existiert nicht + Erledigt + Bearbeiten + Eine Signatur ver�ndern + Beschwerde ver�ndern + Details �ndern + �ndere %group_name% + e-Mail + EMail + e-Mail Adresse + Angestellter + Angestellte + Arbeitgeber + Arbeitgeber + Fehler + gleich + existiert + existieren mindestens + existieren h�chstens + Option erweitern # %extend_id% gel�scht. + Die Ergebnisliste um die folgende Attribute erweitern + Erweiterte Suchoptionen + falsch + Datei + Dateien + Dateien + Vorname Vornamen + Fu�zeile + Freelancer + Von + Lade + Glossare + Suche + Zu den Suchergebnissen gehen + Gruppe + Gruppe -&gt; + Gruppenname + Gruppen + Gruppen + hat sich eingeloggt + hat sich niemals eingeloggt + Kopfzeile Hilfetext - Nachname - Kontakte limitieren auf + Historie + Suchen + in der Suche + Unberechtigt + ung�ltiger Objekttyp + irrelevant + ist -> + ist nach -> + ist vor -> + ist gr��er als -> + ist kleiner als -> + ist mehr als -> + ist nicht -> + ist nicht eingerichtet + ist eingerichtet + letztes + Nachnamen + Letzte �nderung + Sp�tester + Brief + Brief + Briefkopf + Einschr�nkung der Kontakte auf + -- Gruppen -------------------------- + -- Meine Suchen --------------------- + -- keine Signatur einbinden -- + -- k�rzlich durchgef�hrte Suchen -- + -- Gruppe erste Ebene -- + Eine neue %object_type% hinzuf�gen und den ausgew�hlten Gruppen zuordnen + Hinzuf�gen neuer %rels.relationship% + Hinzuf�gen Beziehungstyp + Zu markierter/n Gruppe/n hinzuf�gen + Erweiterte Suchen sind sehr vielf�ltig, aber sie ben�tigen spezifischen Input + Alle Suchen beachten keine Gro�- und Kleinschreibung. Wenn mehr als ein Kontakt der Suche entspricht, so wird eine Ergebnisliste angezeigt. Wenn nur ein Kontakt den Suchkriterien entspricht, dann wird dieser direkt angezeigt. + Wenigstens %times% %role% sind verwandt + %attribute_pretty% Gebietskennziffer ist: <strong>%option_pretty%</strong> + %attribute_pretty% Gebiteskennziffer ist nicht: <strong>%option_pretty%</strong> + %attribute_pretty% enth�lt: <strong>%value%</strong> + %attribute_pretty% L�nderkennziffer ist: <strong>%option_pretty%</strong> + %attribute_pretty% L�nderkennziffer ist nicht: <strong>%option_pretty%</strong> + %attribute_pretty% Land ist: <strong>%country_pretty%</strong> + %attribute_pretty% Land ist nicht: <strong>%country_pretty%</strong> + %attribute_pretty% enth�lt nicht: <strong>%value%</strong> + %attribute_pretty% ist nach: <strong>[lc_time_fmt %value% %q]</strong> + %attribute_pretty% ist vor: <strong>[lc_time_fmt %value% %q]</strong> + %attribute_pretty% is gr��er als: <strong>%value%</strong> + %attribute_pretty% ist weniger als: <strong>%value%</strong> + %attribute_pretty% is weniger als <strong>%interval%</strong> ago + %attribute_pretty% ist nicht gesetzt + %attribute_pretty% ist nicht: <strong>%option_pretty%</strong> + %attribute_pretty% ist gesetzt + %attribute_pretty% ist: <strong>%option_pretty%</strong> + %attribute_pretty% ist: <strong>%value%</strong> + %attribute_pretty% Bundesland/Bezirk ist: <strong>%value%</strong> + %attribute_pretty% Bundesland/Bezirk ist nicht: <strong>%value%</strong> + %attribute_pretty% PLZ startet mit: <strong>%value%</strong> + %attribute_pretty% PLZ startet nicht mit: <strong>%value%</strong> + <br><br>Diese Suche speichern unter + Die ausgew�hlten Kontakte �ndern + Kommentare in den letzten -> + %comments.pretty_date% an %comments.pretty_time% - + Verwaltung der Kontakte + Kontakt wurde im Zeitintervall kommentiert: <strong>%interval%</strong> + Kontakt erstellt in den letzten: <strong>%interval%</strong> + Kontakt hat sich eingeloggt + Der Kontakt hat sich innerhalb der letzten: <strong>%interval%</strong> eingeloggt + Kontakt hat sich nie eingeloggt + Kontakt hat sich in den letzten <strong>%interval%</strong> nicht eingeloggt. + In der Suche %search_link% + Zu dem Kontakt wurde seit <strong>%interval%</strong> kein Kommentar hinterlassen. + Der Kontakt wurde nicht innerhalb der letzten <strong>%interval%</strong> erstellt. + Der Kontakt wurde seit <strong>%interval%</strong> nicht upgedatet + Kontakt Rel Arbeitverh�ltnis + Kontakt Beziehungen + Kontakt Rels Arbeitsverh�ltnisse + Der Kontakt wurde in den letzten <strong>%interval%</strong> upgedatet. + %contacts@ wurden gel�scht + L�nderkennziffer ist nicht -> + Erstellt in den letzten -> + Zurzeit ist die Gruppe in der Lage, die folgenden Beziehungstypen zu nutzen: + Debugging Code - Nur SW Admins sehen dies + Definition eines neuen Beziehungstyps + Selektierte Kontakte l�schen + L�schen der markierten Dateien + Diesen Kontakt komplett l�schen (nicht wieder r�ckg�ngig machbare Aktion!) + Selektierten Kontakten eine E-mail or einen Brief schreiben + Einen Text in einer normalen Suchbox zu schreiben, bedeutet dass eine Suche ausgef�hrt wird wo: + Bestehende Beziehungen + "First Names" enth�lt "Search_Word" oder + Vorname ist erfoderlich + Gruppe'%group_name%' erstellt + Gruppe '%group_name%' upgedated +Deutsch(DE) + Gruppen Informationen gespeichert. + hat sich eingeloggt innerhalb -> + hat sich nicht eingeloggt innerhalb -> + In einer normalen Suche suchen wir nach "D Jane". Das erste Suchwort ("D") findet Kontakt 123 (via "Doe"), 234 (via "Doe") und 345 (via "Alfred"). Das zweite Suchwort ("Jane") finder nur den Kontakt 123. Daher entspricht nur ein Kontakt beiden Suchkriterien und nur "Jane Doe" (Kontakt 123) wird vom System angezeigt. + Wenn mehrere W�rter verwendet werden, dann m�ssen alle W�rter den o.g. Kriterien entsprechen. Wenn z.B. unsere Kontaktdatenbank die folgenden Eintr�ge enth�lt: + Instanz Berechtigungen - !NOCH UNFERTIG! + Ungen�gende Berechtigungen + Ung�ltige Eingabe, Sie gaben f�r die Eingabemaske '%form%'an, sollten aber nur eingeben: top, bottom, none + Labels wurden bisher nicht implementiert + "Last Name" enth�lt "Search_Word" oder + Nachname notwendig + Letztes Update: %update_date% + <li> Die von Ihnen eingegebene Rolle \"%pretty_name%\" oder der Plural \"%pretty_plural%\" existieren bereits. + Gehen Sie sicher, dass Sie nicht die gleichen Attribute zu mehreren Gruppen hinzuf�gen + Weder der Personen- noch der Organisationstypus ist g�ltig, was ist da passiert Admin? + nicht kommentiert in den letzten -> + nicht erstellt in den letzten -> + nicht upgedatet in den letzten -> + der folgenden Bedingungen:<br> + Sobald Sie diese Briefe ausgedruckt haben k�nnen Sie <a href="%return_url%">dorthin zur�ckkehren wo Sie waren</a>. + Sobald der Release ansteht, wird dieses im Softwarecode ber�cksichtigt. + "Organization Name" enth�lt "Search_Word" oder + Organisationsbeziehung + Organisationsbeziehungen + "Party ID" entspricht "Search_Word" + Personen oder Organisationen + Person - Registrierter User + Personen und Organisationen + %pretty_plural_list_name% gefunden bei der Suche, bitte versuchen Sie es erneut oder erstellen einen neuen Kontakt + Bei der Erstellung k�nnen sie nutzen: &lt;a href=&quot;message-help&quot;&gt;mail merge substitutions&lt;/a&gt;. Die gebr�uchlichsten Platzhalter sind \{name\} \{first_names\}, \{last_name\}, \{home_address\} und \{date\} + Entfernen von markierter/n Gruppe(n) + Von Gruppe entfernen + %role% existiert + %role% ist in der Suche %search_link% + %role% nicht in der Suche %search_link% + Einige der notwendigen Elemente f�r dieses Formular fehlen. Bitte kontaktieren Sie einen Adminstrator und gehen Sie sicher, dass die folgenden Attribute in dem Formular der Standardgruppe f�r diesen Objekttypen vorhanden sind: + Einige der notwendigen Elemente dieses Formulars fehlen. Bitte kontaktieren Sie einen Adminstrator und gehen Sie sicher, dass die folgenden Attribute eingebunden sind: + Bundesland/Region ist nicht -> + Der Objekttyp %contact_link% wurde hinzugef�gt + Die Aktion ist nicht g�ltig + Der Kontakt ist in der Gruppe: <strong>%group_pretty%</strong> + Der Kontakt ist nicht in der Gruppe: <strong>%group_pretty%</strong> + Der spezifizierte KOntakt existiert nicht + Der spezifizierte Kontakt ist keiner der Kontakte in dieser Beziehung + Die Standardgruppe muss den Vornamen und den Nachnamen f�r ein Personenformblatt enthalten sowie einen Organisationsnamen f�r ein Organisationsformblatt, beide ben�tigen eine E-Mail Adresse. + Die Datei %message% wurde erfolgreich upgeloadet + Die Dateien %message% wurden erfolgreich upgeloadet + Der erste spezifizierte Kontakt existiert nicht + Die erste spezifizierte Rolle existiert nicht + Der Parameter RecentOnTopP ist f�r das General Comments Package nicht korrekt gesetzt, bitte geben Sie entweder eine '0' oder eine '1' ein. + Die party_id existiert nicht + Die Abfrage \"%type% %var_list%\" ist nicht l�nger g�ltig, da: %error_message + Die Abfrage \"%type% %var_list%\" ist nicht l�nger g�ltig. Kontaktieren Sie einen Administrator. + Der Name des Empf�ngers und seine Anschriftdaten werden automatisch eingef�gt. Es ist m�glich mit UMschl�gen mit Sichtfenstern zu arbeiten. + Der zweite spezifizierte Kontakt existiert nicht + Die zweite spezifizierte Rolle existiert nicht + Es gab ein Problem mit Ihrer Eingabe. Dieser Beziehungstyp kann nicht existieren. + Diese Aktion kann nicht f�r nicht zugewiesene (unmapped) Gruppen durchgef�hrt werden + Dieser Kontakt ist kein Mitglied einer Gruppe + Diese Gruppe ist bereits der Standard + Diese Gruppe wurde schon zugewiesen (mapped) + Dies ist meine Standard Signatur + Die spezifizierte Signatur existiert entweder nicht oder sie geh�rt nicht zu Ihnen + Der User wartet noch auf Genehmigung vom Administrator + Dieser User wurde noch nicht genehmigt + Der Titel wird in der Nachricht nicht angezeigt, er wird daf�r genutzt, die richtige Nachricht auszuw�hlen. + Nicht m�glich die group-id abzurufen + Upgedatet in den letzten -> + Dieser Person als User registrieren/ upgraden + What role does %contact_name_one% have when %contact_name_two% is a %secondary_role_pretty%: + Sie k�nnen diesen Kontakt nicht zu mehr Gruppen zuweisen. + Sie k�nnen keine Untergruppen als Standardgruppe bestimmen + Sie k�nnen keine Gruppen zuweisen (mappen), deren Eltern-Gruppen nicht zugewiesen (mapped) sind + Sie k�nnen keinen Brief an den folgenden Kontakt schicken: %invalid_recipients% + Sie k�nnen keine Nachricht an die folgenden Kontakte schicken: %invalid_recipients% + Sie k�nnen keine e-Mail an die folgenden Kontakte schicken: %invalid_recipients% + Sie k�nnen die Standardgruppe nicht l�sen (unmap) + Sie haben keine Berechtigung daf�r, User Gruppen zuzuweisen + Sie haben keinen g�ltigen Kontakttypen spezifiziert + Sie haben einen ung�ltigen Objekttypen spezifiziert + Sie haben eine ung�ltige Gr��e f�r eine Textfl�che spezifiziert + Sie m�ssen einige Kontakte markieren, um einen Massen-Update durchf�hren zu k�nnen + Ihr Administrator muss eine Standardgruppe auf den Seiten <a href="admin">admin pages</a> zuweisen und hinzuf�gen + Sie m�ssen einige Kontakte bereitstellen, um eine Nachricht senden zu k�nnen + Sie haben einen ung�ltigen Nachrichtentyp angebenen + PLZ startet nicht mit -> + PLZ startet mit -> + Mailing + Adresszusammenstellung + Resultate der Mail Zusammenfassung (mail merge) + Dateien an Kontakt schicken aktuell machen - Markierte Kontakte auf "aktuell" setzen + ver�ffentlichen + Die markierten Kontakte aktuell machen + Kategorien f�r diese Gruppe + Nachricht + Nachricht wird ben�tigt + Vorlagen + Mitteilungen + mein- + Modifiziert durch: + Meine Nachrichten: + Meine Suchen + Meine Signaturen Name + Name wird ben�tigt + Neue/r + N�chster Parameter + (keine) + Normale Suchen: + Nicht konfiguriert + niucht in der Suche Anzahl an Spalten + Objekt: + object_id + ungerade von - Sortierung + Angebote + Offen + oder + Reihenfolge Organisation + Organisationen Formblatt + Organisationen + Organisationen + Andere Optionen + Ergebnis + Besitzer + Gezahlt: + Papiertyp + �bergeordnete Gruppe + Teil von + Party Revision + Party Versionen + Kontakte + Personen + Personen oder Organisationen + Personen oder Organisationen + Rabatt in Prozent: + Berechtigungen + Zugriffsrechte f�r Standardgruppe Person - ben�tigt - Suche - e-mail Nachricht an markierte Kontakte schicken - e-Mail schicken - zeigen - sortieren nach + Personen Formblatt + Angezeigter Name + Der Name der bei dieser Liste als �berschrift angezeigt wird. + Voransicht + Drucken + Brief drucken + Prozesse + PROJEKT + Projekt: + Projekte + Projektaufgaben + �ffentlicher + �ffentliche Nachrichten + �ffentliche Seite + �ffentlich verf�gbare Suchen + Abfrage + LESEN SIE BITTE DIESES + Empf�nger + R�ckerstattung + Beziehung + Beziehung hinzugef�gt + Beziehung gel�scht + Beziehungstypen + Beziehung upgedatet + Beziehungen + Beziehungen + Standard (Default) entfernen + Entferne erweirterte Optionen, die als Standard f�r die search_id #%search_id% gesetzt sind + Von Gruppe entfernen + Von Gruppe entfernen + Von Gruppe entfernen + Erforderlich + Ergebnisse: + Zur�ck zu %title% + Rolle + Rollenname + Rolle eins + Rolle Singular + Rolle zwei + Rollen + Speichern + Speichern und Weiteren hinzuf�gen + Speichern als + Nachricht speichern als + Speichern dieser Suche + Gespeicherte Suchen + Suchen + Existierenden suchen + Suche nach + Suche nach allen <strong>%object_type%</strong> wo + Suche nach allen %object_type% die + Suchhilfe + Suchen + Markieren + Senden + Eine e-Mail Nachricht an die markierten Kontakte schicken + e-Mail senden + Standard (Default) setzen + Standard (Default) setzen + Einstellungen + Gemeinsam genutzte Suchen + Anzeigen: + Anzeigen + Signatur + Signaturen + Sortieren nach + Sortieren nach: + Bundesland ist -> Status - "Widget" + Gespeicherte erweiterte Optionen + Erweiterte Optionen, die als Standard f�r die search_id #%search_id% gesetzt werden k�nnen + Betreff + Betreff muss ausgef�llt werden + (Unter)Abfrage + Die (Unter)Abfrage, die durchgef�hrt wird, um das Ergebnis zu holen. + �bersicht + �berblick + Bearbeiter: + Tabelle + Aufgaben + Die spezifizierte Aktion ist ung�ltig + Der Fehler war: %errmsg + Die Nachricht %title% wurde zu Ihren Nachrichten kopiert + Die Nachricht %title% wurde gel�scht + Die Nachricht %title% wurde ver�ffentlicht + Die spezifizierte owner_id ist nicht g�ltig + Die Suche "%title%" wurde zu Ihren Suchen kopiert + Die Suche "%title%" wurde gel�scht + Die Suche "%title%" wurde �ffentlich zur Verf�gung gestellt + Dieser Kunde hat keine E-Mail Addresse daher wird die Addresse des Arbeitgebers benutzt (%emp_addr%) + Dieser "Variablen Name" existiert schon + Zeiten + Titel + Grund: + zu + richtig + Auftragswert: + Typ + Update + Update Dateinamen + Update durch + Update am + Datei hochladen + Mehrere Dateien uploaden + Informationen zu dem User Account + Berechtigt + Variablen Name + Name der Variable, die in der erweiterten Suche verwendent werden soll. + Alle Rollen ansehen + N�chstes sehen + Zum Kundenportal + Alle Ver�nderungen ansehen + die �bereinstimmen mit + Widget + mit + Sie k�nnen diese Suche ausweiten durch: + Ihre Nachricht wurde an: <strong>%recipients%</strong> gesendet. + Ihre Signaturen Index: openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml 13 Jan 2005 13:56:59 -0000 1.2 +++ openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml 30 Nov 2005 15:31:01 -0000 1.2.2.1 @@ -1,42 +1,531 @@ - + + -- select a group -- + -- Create New Message -- + -- None -- + --select one-- Action + Actions + Add: + Add + Add a Group Add a Person Add an Organization + Add Comment + Add complaint to + Add Condition + Add Email Message + Add Group + Add Letter Message + Add Message + Add New + Add new %object_type% selected groups + Add Organization + Add Person + Add Search + Add Signature Add the selected contacts to a category Add to Category + Add to Group + Add to group + Add to Groups + Add User + Address + Admin + Administer Contacts + Advanced Search + Advanced Searches + Aggregate + Aggregate by + Aggregated + aggregated by: + Set it to true if you want to use this extend in "Aggregated Result Page" All + All / Edit + All Contacts + and Answer + Any Archive Archive the checked contacts Archived + area code is -> + area code is not -> + Type of Relationship + Associated Files: + at Attribute + Attribute -> + Attribute Name Attributes + Available Attributes + Available Options + Belongs to + Body + Bulk Update + Cancel + CC + Send copy to multiple addresses separated by ";" + Changed Date: + Changes + Check/Uncheck + Clear Clear the currently selected Category Clear the currently selected Search + Comment Added + Comments + Complaint + Extensive description of the complaint, especially why it was given. + How much was paid to the supplier + Rebate in percent that has had to be given due to the complaint + Amount paid back to the customer + What is the status of the complaint + Short name for identifying the complaint + Turnover that was made with the customer with regards to the complaint + Complaints + Configuration Error Contact + Contact -> + contact is in -> + contact is not in -> + Contact Relationship Contact Type + Contact Type One + Contact Type Two + Contacts + contacts + contains -> + Copy + country code is -> + country is -> + country is not -> + Create + Create a message + Create a role + Create a Signature + Create a user account for this person + Create Email + Create Letter + Create project + Create role + Create User + CSV Current + Customer: + Customer has no employees. + Date + days + Default + Default attributes + Delete + Delete + Description: + A short description of what the subquery does. + Details + does not contain -> + does not exist + Done + Edit + Edit a Signature + Edit complaint + Edit Details + Edit %group_name% + Email + EMail Email Address + Employee + Employees + Employer + Employers + Error + even + exists + exists at least + exists at most + Extend Option # %extend_id% deleted. + The "Extended Query" return an error + Extend result list by + extended by: + Extended Search Options + False + File + Files + files + First Name First Names + Footer + Freelancers + From + Get + Glossars + Go + Go to search results + Group + Group -> + Group Name + Groups + groups + has logged in + has never logged in + Header Help Text + History + Searches + in the search + Invalid + Invalid Object Type + irrelevant + is -> + is after -> + is before -> + is greater than -> + is less than -> + is more than -> + is not -> + is not set + is set + last Last Name + Last updated + Latest + Letter + Letter + Letterhead Limit Contacts to + -- Groups -------------------------- + -- My Searches --------------------- + -- no not include a signature -- + -- Recent Searches -- + -- top level group -- + Add new %object_type% and insert into selected groups + Add new %rels.relationship% + Add relationship type + Add to Selected Group(s) + Advanced searches are very powerful but in return they require very specific input... + All searches are case insensitive, capitalization does not matter. If more than one contact match the search a list of results is returned. If only one contact meets the search criteria you are redirected to that contact. + At least %times% %role% are related + %attribute_pretty% area code is: <strong>%option_pretty%</strong> + %attribute_pretty% area code is not: <strong>%option_pretty%</strong> + %attribute_pretty% contains: <strong>%value%</strong> + %attribute_pretty% country code is: <strong>%option_pretty%</strong> + %attribute_pretty% country code is not: <strong>%option_pretty%</strong> + %attribute_pretty% country is: <strong>%country_pretty%</strong> + %attribute_pretty% country is not: <strong>%country_pretty%</strong> + %attribute_pretty% does not contain: <strong>%value%</strong> + %attribute_pretty% is after: <strong>[lc_time_fmt %value% %q]</strong> + %attribute_pretty% is before: <strong>[lc_time_fmt %value% %q]</strong> + %attribute_pretty% is greater than: <strong>%value%</strong> + %attribute_pretty% is less than: <strong>%value%</strong> + %attribute_pretty% is less than <strong>%interval%</strong> ago + %attribute_pretty% is not set + %attribute_pretty% is not: <strong>%option_pretty%</strong> + %attribute_pretty% is set + %attribute_pretty% is: <strong>%option_pretty%</strong> + %attribute_pretty% is: <strong>%value%</strong> + %attribute_pretty% state/province is: <strong>%value%</strong> + %attribute_pretty% state/province is not: <strong>%value%</strong> + %attribute_pretty% zip/postal starts with: <strong>%value%</strong> + %attribute_pretty% zip/postal does not start with: <strong>%value%</strong> + <br><br>save this search as + Bulk update the selected contacts + commented on in last -> + %comments.pretty_date% at %comments.pretty_time% - + Contact Administration + Contact commented on in the last: <strong>%interval%</strong> + Contact created in the last: <strong>%interval%</strong> + Contact has logged in + Contact has logged in within the last: <strong>%interval%</strong> + Contact has never logged in + Contact has not logged in within the last: <strong>%interval%</strong> + in the search %search_link% + Contact not commented on in the last: <strong>%interval%</strong> + Contact not created in the last: <strong>%interval%</strong> + Contact not updated in the last: <strong>%interval%</strong> + Contact Rel Employment + Contact Relationships + Contact Rels Employment + Contact updated in the last: <strong>%interval%</strong> + The contact was removed from the group + %contacts@ were deleted + country code is not -> + created in the last -> + Currently, the group is able to handle the following types of relationships: + Debugging Code - Only SW Admins See This + Define a new relationship type + Delete the selected Contacts + Delete the selectted files + Completely delete this contact (irreversible action) + E-mail or Mail the selected contacts + Entering a string in the normal search box means that a search will be performed where: + Existing Relationships + "First Names" contains "Search_Word" or + First Names is required + Group '%group_name%' Created + Group '%group_name%' Updated + Group Information Saved. + has logged in within -> + has not logged in within -> + If in a normal search we search for "D Jane". The first Search_Word ("D") matches contacts 123 (via "Doe"), 234 (via "Doe"), and 345 (via "Alfred"). And the second Search_Word ("Jane") matches only contact 123. Thus only one contact meets both requirements and "Jane Doe" (contact 123) is returned. + If multiple words are used then all words must match the above critera. So, for example if our contacts database contains these entries: + Instance Permissions - Not done yet + Insufficient Permissions + Invalid input, you specified form as '%form%' but should only specify: top, bottom, none + labels are not implemented yet + "Last Name" contains "Search_Word" or + Last Name is required + Last updated: %update_date% + <li> The role you entered \"%pretty_name%\" or the plural \"%pretty_plural%\" already exists. + Make sure you do not add the same attribute to multiple groups + neither person nor org type is valid, what happened admin? + not commented on in last -> + not created in the last -> + not updated in the last -> + of the following conditions:<br> + Once you have printed these letters you may <a href="%return_url%">return to where you were</a>. + Once ready for release this will be taken care of in code + "Organization Name" contains "Search_Word" or + Organization Relationship + Organization Relationships + "Party ID" equals "Search_Word" + People or Organizations + Person - Registered Users + Person or Organization + %pretty_plural_list_name% found in search, please try again or add a new contact + remember that you can use mail merge substitutions. The most common wildcards are {name} {first_names}, {last_name}, {salutation}, {home_address} and {date} + Remove from Selected Group(s) + Remove from this Group + %role% exists + %role% in the search %search_link% + %role% not in the search %search_link% + Some of the required elements for this form are missing. Please contact an administrator and make sure that the following attributes are included in the default group's form for this object type: + Some of the required elements for this form are missing. Please contact an administrator and make sure that the following attributes are included: + state/province is not -> + The object type %contact_link% was added + the action supplied is not valid + The contact is in the group: <strong>%group_pretty%</strong> + The contact is NOT in the group: <strong>%group_pretty%</strong> + The contact specified does not exist + The contact specified is not one of the contacts in this relationship + The default group must have first_names and last_name for person objects and name for organization objects, both of them need email + The file %message% was successfully uploaded + The files %message% were successfully uploaded + The first contact specified does not exist + The first role specified does not exist + The parameter RecentOnTopP is not set correctly for the General Comments package, please enter either a '0' or a '1' + The party_id specified does not exist + The query \"%type% %var_list%\" is no longer valid because: %error_message + The query \"%type% %var_list%\" is no longer valid. Contact an admin. + The recipeints name and mailing address will automatically be included so that they work with window envelopes + The second contact specified does not exist + The second role specified does not exist + There was a problem with your input. this type of relationship cannot exist. + There was an error processing your request + This action cannot be taken for unmapped groups + This contact is not part of any groups + This group is already the default + This group is already mapped + this is my default signature + This signature specified either does not exist or does not belong to you + This user is awaiting administrator approval + This users has not been approved + Title is not shown in the message, it is used to select the appropriate message. + Unable to retrieve group_id + updated in the last -> + Upgrade this person to a user + What role does %contact_name_one% have when %contact_name_two% is a %secondary_role_pretty%: + You cannot add this contact to more groups. + You cannot make sub groups the default group + You cannot map groups whose parent groups are not mapped + You cannot send a letter to the following contacts: %invalid_recipients% + You are unable to send a message to the following contacts: %invalid_recipients% + You cannot send an email message to the following contacts: %invalid_recipients% + You cannot unmap the default group + You do not have permission to add users to groups + You have not specified a valid contact type + You have specified an invalid Object Type + You have specified an invalid size for the textarea + You need to select some contacts to bulk update + Your administrator must map and add a default group in the <a href="admin">admin pages</a> + Your need to provide some contacts to send a message + Your provided an invalid Message Type + zip/postal does not start with -> + zip/postal starts with -> + Mail + Mail Merge + Mail Merge Results + Mail to contact Make Current + Make Public Make the checked contacts current + Manage Group Categories + Message + Message is required + Messages + messages + mine- + Modify By: + My Messages + My Searches + My Signatures Name + Name is required + New + Next + (none) + Normal Searches + Not Configured + not in the search Number of Rows + Object: + Object_id + odd of + Offers + Open + or Ordering Organization + Organization Form + Organizations + organizations + Other Options + Output + Owner + Paid: + Paper Type + Parent Group + Part of + Party Revision + Party Revisions + People + people + People or Organizations + people or organizations + Percent: + Permissions + Permissions for default group Person + Person Form + Pretty Name + The Pretty Name to use in the list label. + Preview + Print + Print Letter + Processes + PROJECT + Project: + Projects + Project Tasks + Public + Public Messages + Public Page + Public Searches + Query + READ THESE + Recipients + Refund + Relationship + Relationship Added + Relationship Deleted + Relationship types + Relationship Updated + Relationships + relationships + Remove Default + Remove extended options set as default for search_id #%search_id% + Remove From Group + Remove from Group + Remove from Group Required + Results + Return to %title% + Role + Role Name + Role One + Role Singular + Role Two + Roles + Save + Save and Add Another + Save As + Save Message As + Save this Search + Saved Searches Search + Search Existing + Search for + Search for all <strong>%object_type%</strong> where + Search for all %object_type% who are + Search for <b>people or organizations</b> + Search Help + Search List + searches + Select + Send Send an email message to the selected contacts Send Email + Set Default + Set default + Settings + Shared Searches + Show Showing + Signature + signatures Sort By + Sort by + state/province is -> Status + Stored Extended Options + Extended Options to set as default for search_id #%search_id% + Subject + Subject is required + Subquery + The subquery to be executed to grab the result. + Summary + Summary View + Supplier: + Table + Tasks + The action specified is invalid + The error was: %errmsg + The message %title% was copied to your messages + The message %title% was deleted + The message %title% was made public + The owner_id specified is not valid + The search "%title%" was copied to your searches + The search "%title%" was deleted + The search "%title%" was made public + This contact doesn't have an email, you are going to use it's employer email (%emp_addr%) + This "Variable Name" is already present + times + Title + Title: + To + True + Turnover: + Type + Update + Update filenames + Updated By + Updated On + Upload File + Upload File + Upload More + User Account Information + Valid + Variable Name + Name of the variable to use in the extend search. + View all roles + View next + Visit Club + Watch all changes + which match Widget + with + Working Project Tasks + You can extend this search by: + Your message was sent to: <strong>%recipients%</strong> + your signatures Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/attributes-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/attributes-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/attributes-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/attributes-populate.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/sql/postgresql/contacts-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/contacts-create.sql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/sql/postgresql/contacts-create.sql 13 Jan 2005 13:57:00 -0000 1.2 +++ openacs-4/packages/contacts/sql/postgresql/contacts-create.sql 30 Nov 2005 15:31:01 -0000 1.2.2.1 @@ -7,70 +7,129 @@ -- -create table contact_archives ( - party_id integer - constraint contact_archives_party_id_fk references parties(party_id) - constraint contact_archives_party_id_pk primary key +-- all contacts are parties. we are making parties content repository items, +-- so we need party revisions + +create table contact_party_revisions ( + party_revision_id integer + constraint contact_party_revisions_id_fk references cr_revisions(revision_id) + constraint contact_party_revisions_id_pk primary key ); --- this is used to create forms for orgs and persons (since they need object_ids) to map to. -create table contact_object_types ( - object_id integer not null - constraint contact_object_type_object_id_fk references acs_objects(object_id) - constraint contact_object_type_object_id_pk primary key, - object_type varchar(100) not null, - UNIQUE(object_type) +-- create the content type +select content_type__create_type ( + 'contact_party_revision', -- content_type + 'content_revision', -- supertype + '#contacts.Party_Revision#', -- pretty_name + '#contacts.Party_Revisions#', -- pretty_plural + 'contact_party_revisions', -- table_name + 'party_revision_id', -- id_column + 'contact_party_revision__name' -- name_method ); +-- i need to create the content_folder contact_parties, it is not bound to a package_id +-- since the package_id is not used by contacts - which uses the groups system for package +-- maintenance. +-- contrary to "most" packages that use the content repository, we will not be +-- specifying new item_ids. Since all contacts are parties, we are going to set +-- all parties that use the contacts system to have an content_items(item_id) +-- that is equal to the parties(party_id). -\i contacts-package-create.sql +-- since all contacts are parties we already have good "group" mechanisms built into the core +-- however, we do not want people to view all groups at once, so the calendar instance +-- administrator can selectively give certain calendar instances access to certain groups +-- +-- by default each new contacts instance will be given access to its subsite's group. For +-- example: all users on a default openacs install are memembers of the "Main Site Members" +-- group. If a calendar instance were mounted under that subsite, all "Main Site Members" +-- would be accessible to that calendar instance. +-- +-- just as is the case with the calendar package all "users" of contacts (i.e. users that +-- have write access to at least one contacts instance will be assigned a private calendar) +-- +-- which calendars can be viewed by which calendar instance is handled via parameters - unlike +-- many packages. This allows for more flexable instance and sharing management - where +-- one instances shared calendar can also be accesible to another instance. -create view contacts as - select organization_id as party_id, - 'organization' as object_type, - name, - name as organization_name, - legal_name, - reg_number, - null as first_names, - null as last_name, - name as sort_first_names, - name as sort_last_name, - contact__party_email(organization_id) as email, - contact__party_url(organization_id) as url, - 'f' as user_p, - contact__status(organization_id) as status - from organizations -union - select person_id as party_id, - 'person' as object_type, - first_names || ' ' || last_name as name, - null as organization_name, - null as legal_name, - null as reg_number, - first_names as first_names, - last_name as last_name, - first_names || ' ' || last_name as sort_first_names, - last_name || ', ' || first_names as sort_last_name, - contact__party_email(person_id) as email, - contact__party_url(person_id) as url, - contact__person_is_user_p(person_id) as user_p, - contact__status(person_id) as status - from persons - where person_id != '0' +create table contact_groups ( + group_id integer + constraint contact_groups_id_fk references groups(group_id) + constraint contact_groups_id_nn not null, + default_p boolean default 'f' + constraint contact_groups_default_p_nn not null, + package_id integer + constraint contact_groups_package_id_fk references apm_packages(package_id) + constraint contact_groups_package_id_nn not null, + unique(group_id,package_id) +); + +create table contact_groups_allowed_rels ( + group_id integer + constraint contact_groups_id_fk references groups(group_id) + constraint contact_groups_id_nn not null, + rel_type varchar(100) + constraint contact_groups_allowed_rels_type_fk references acs_rel_types(rel_type), + package_id integer + constraint contact_groups_package_id_fk references apm_packages(package_id) + constraint contact_groups_package_id_nn not null, + unique(group_id,package_id) +); + + +create table contact_signatures ( + signature_id integer + constraint contact_signatures_id_pk primary key, + title varchar(255) + constraint contact_signatures_title_nn not null, + signature varchar(1000) + constraint contact_signatures_signature_nn not null, + default_p boolean default 'f' + constraint contact_signatures_default_p_nn not null, + party_id integer + constraint contact_signatures_party_id_fk references parties(party_id) + constraint contact_signatures_party_id_nn not null, + unique(party_id,title,signature) +); + +-- this view greatly simplifies getting available roles for various contact types +create view contact_rel_types as +( select rel_type, + object_type_one as primary_object_type, + role_one as primary_role, + object_type_two as secondary_object_type, + role_two as secondary_role + from acs_rel_types + where rel_type in ( select object_type from acs_object_types where supertype = 'contact_rel') +) +UNION +( select rel_type, + object_type_two as primary_object_type, + role_two as primary_role, + object_type_one as secondary_object_type, + role_one as secondary_role + from acs_rel_types + where rel_type in ( select object_type from acs_object_types where supertype = 'contact_rel') +) ; +create table contact_rels ( + rel_id integer + constraint contact_rels_rel_id_fk references acs_rels(rel_id) on delete cascade + constraint contact_rels_rel_id_pk primary key +); --- The attribute structure. -\i attributes-create.sql -\i attributes-package-create.sql +create table organization_rels ( + rel_id integer + constraint organization_rels_rel_id_fk references membership_rels(rel_id) on delete cascade + constraint organization_rels_rel_id_pk primary key +); -\i attributes-populate.sql +\i contacts-package-create.sql +\i contacts-search-create.sql +\i contacts-messages-create.sql -\i views-create.sql -\i telecom-number-missing-plsql.sql Index: openacs-4/packages/contacts/sql/postgresql/contacts-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/contacts-drop.sql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/sql/postgresql/contacts-drop.sql 13 Jan 2005 13:57:00 -0000 1.2 +++ openacs-4/packages/contacts/sql/postgresql/contacts-drop.sql 30 Nov 2005 15:31:01 -0000 1.2.2.1 @@ -6,30 +6,30 @@ -- -- +drop table contact_search_extend_map; +drop table contact_search_conditions; +drop table contact_searches; +drop table contact_extend_options; +select drop_package('contact_search'); +select acs_object__delete(search_id) from contact_searches; +select acs_object_type__drop_type('contact_search','t'); --- The view structure. -\i views-drop.sql +drop view contact_rel_types; +drop table contact_signatures; +drop table contact_groups; +drop table contact_rels; +drop table organization_rels; +drop table contact_complaint_track; --- The attribute structure. -\i attributes-drop.sql +select content_type__drop_type ('contact_party_revision','t','t'); +--drop table contact_party_revisions; +select acs_rel_type__drop_type('organization_rel','t'); +select acs_rel_type__drop_type(object_type,'t') from acs_object_types where supertype = 'contact_rel'; +select acs_rel_type__drop_type('contact_rel','t'); - -drop view contacts; -drop table contact_archives; -drop table contact_object_types; - +-- procedure drop_type select drop_package('contact'); +select drop_package('contact_rel'); +select drop_package('contact_party_revision'); -delete from acs_objects where object_type = 'contact_object_type'; -create function inline_0 () -returns integer as ' -begin - - PERFORM acs_object_type__drop_type (''contact_object_type'',''f''); - - return 0; -end;' language 'plpgsql'; - -select inline_0 (); -drop function inline_0 (); - +drop sequence contact_extend_search_seq; \ No newline at end of file Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/contacts-messages-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/sql/postgresql/contacts-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/contacts-package-create.sql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/sql/postgresql/contacts-package-create.sql 13 Jan 2005 13:57:01 -0000 1.2 +++ openacs-4/packages/contacts/sql/postgresql/contacts-package-create.sql 30 Nov 2005 15:31:01 -0000 1.2.2.1 @@ -7,130 +7,288 @@ -- -create function inline_1 () -returns integer as ' +select define_function_args('contact_party_revision__new', 'party_id,party_revision_id,creation_date;now(),creation_user,creation_ip'); + + +create or replace function contact_party_revision__new ( + integer, -- party_id + integer, -- party_revision_id + timestamptz, -- creation_date + integer, -- creation_user + varchar -- creation_ip +) returns integer +as ' +declare + p_party_id alias for $1; + p_party_revision_id alias for $2; + p_creation_date alias for $3; + p_creation_user alias for $4; + p_creation_ip alias for $5; + v_party_revision_id cr_revisions.revision_id%TYPE; + v_party_id cr_items.item_id%TYPE; begin - PERFORM acs_object_type__create_type ( - ''contact_object_type'', - ''Contact Object Type'', - ''Contact Object Types'', - ''acs_object'', - ''contact_object_types'', - ''object_id'', - null, - ''f'', - null, - ''contact__object_type_name'' - ); + v_party_id := contact_party_revision__item_id ( + p_party_id, + p_creation_date, + p_creation_user, + p_creation_ip + ); - return 0; + v_party_revision_id := content_revision__new ( + NULL, -- title + NULL, -- description + now(), -- publish_date + NULL, -- mime_type + NULL, -- nls_language + NULL, -- data + v_party_id, -- item_id + p_party_revision_id, -- revision_id + p_creation_date, -- creation_date + p_creation_user, -- creation_user + p_creation_ip -- creation_ip + ); + PERFORM content_item__set_live_revision (v_party_revision_id); + + insert into contact_party_revisions ( party_revision_id ) values ( v_party_revision_id ); + + return v_party_revision_id; end;' language 'plpgsql'; -select inline_1 (); -drop function inline_1 (); +create or replace function contact_party_revision__item_id ( + integer, -- party_id + timestamptz, -- creation_date + integer, -- creation_user + varchar -- creation_ip +) returns integer +as ' +declare + p_party_id alias for $1; + p_creation_date alias for $2; + p_creation_user alias for $3; + p_creation_ip alias for $4; + v_exists_p boolean; +begin + v_exists_p := ''1'' from cr_items where item_id = p_party_id; + if v_exists_p is not true then + insert into cr_items + (item_id,parent_id,name,content_type) + values + (p_party_id,contact__folder_id(),p_party_id::varchar,''contact_party_revision''); + end if; -create or replace function contact__object_type_create (integer,varchar,timestamptz,integer,varchar,integer) -returns integer as ' + return p_party_id; +end;' language 'plpgsql'; + +create or replace function contact_party_revision__name ( + integer -- revision_id +) returns varchar +as ' declare - p_object_id alias for $1; - p_object_type alias for $2; - p_creation_date alias for $3; - p_creation_user alias for $4; - p_creation_ip alias for $5; - p_context_id alias for $6; - v_object_id integer; + p_revision_id alias for $1; + v_first_names varchar; + v_last_name varchar; + v_organization varchar; + v_name varchar; begin - v_object_id := acs_object__new ( - p_object_id, - ''contact_object_type'', - p_creation_date, - p_creation_user, - P_creation_ip, - p_context_id - ); + v_name := contact__name(item_id) || '' revision '' || to_char(revision_id,''FM9999999999999999999'') from cr_revisions where item_id = p_revision_id; + return v_name; +end;' language 'plpgsql'; +create or replace function contact__folder_id () returns integer +as ' +declare + v_folder_id integer; +begin - insert into contact_object_types - (object_id,object_type) - values - (v_object_id,p_object_type); + v_folder_id := cf.folder_id from cr_items ci, cr_folders cf + where ci.item_id = cf.folder_id + and ci.parent_id = ''0'' + and ci.name = ''contacts''; - return v_object_id; + if v_folder_id is null then + v_folder_id := content_folder__new ( + ''contacts'', + ''Contacts'', + NULL, + ''0'' + ); + end if; + + return v_folder_id; end;' language 'plpgsql'; +select content_folder__register_content_type(contact__folder_id(),'content_revision','t'); - -create or replace function contact__object_type_name (integer) -returns varchar as ' +create or replace function contact__name ( + varchar, -- first_names + varchar, -- last_name + varchar, -- organization + boolean -- recursive_p +) returns varchar +as ' declare - p_object_id alias for $1; - v_name varchar; + p_first_names alias for $1; + p_last_name alias for $2; + p_organization alias for $3; + p_recursive_p alias for $4; + v_name varchar; begin - v_name := object_type from contact_object_types where object_id = p_object_id; + + if p_recursive_p then + if p_first_names is null and p_last_name is null then + v_name := p_organization; + else + v_name := p_last_name; + if p_first_names is not null and p_last_name is not null then + v_name := v_name || '', ''; + end if; + v_name := v_name || p_first_names; + end if; + else + if p_first_names is null and p_last_name is null then + v_name := p_organization; + else + v_name := p_first_names; + if p_first_names is not null and p_last_name is not null then + v_name := v_name || '' ''; + end if; + v_name := v_name || p_last_name; + end if; + end if; + return v_name; end;' language 'plpgsql'; +create or replace function contact__name ( + integer -- party_id +) returns varchar +as ' +declare + p_party_id alias for $1; + v_name varchar; +begin + v_name := contact__name(p_party_id,''f''); + return v_name; +end;' language 'plpgsql'; +create or replace function contact__name ( + integer, -- party_id + boolean -- recursive_p +) returns varchar +as ' +declare + p_party_id alias for $1; + p_recursive_p alias for $2; + v_first_names varchar; + v_last_name varchar; + v_organization varchar; + v_name varchar; +begin + select first_names, last_name + into v_first_names, v_last_name + from persons where person_id = p_party_id; + select name + into v_organization + from organizations where organization_id = p_party_id; -create or replace function contact__party_email (integer) -returns varchar as ' -declare - email__party_id alias for $1; -begin + v_name := contact__name(v_first_names,v_last_name,v_organization,p_recursive_p); - return email from parties where party_id = email__party_id; + return v_name; +end;' language 'plpgsql'; -end;' language 'plpgsql' stable strict; -create or replace function contact__party_url (integer) -returns varchar as ' +create or replace function contact_group__member_count ( + integer -- group_id +) returns integer +as ' declare - url__party_id alias for $1; + p_group_id alias for $1; + v_member_count integer; begin + v_member_count := count(*) from group_distinct_member_map where group_id = p_group_id ; - return url from parties where party_id = url__party_id; + return v_member_count; +end;' language 'plpgsql'; -end;' language 'plpgsql' stable strict; -create or replace function contact__status (integer) -returns varchar as ' +create or replace function contact_group__member_p (integer,integer) returns boolean +as ' declare - p_party_id alias for $1; - v_archived_p boolean; + p_group_id alias for $1; + p_member_id alias for $2; + v_member_p boolean; begin - v_archived_p := ''1'' from contact_archives where party_id = p_party_id; + v_member_p := ''1'' from group_distinct_member_map where group_id = p_group_id and member_id = p_member_id; - if v_archived_p then - return ''archived''; - else - return ''current''; - end if; + if v_member_p is true then + v_member_p := ''1''; + else + v_member_p := ''0''; + end if; -end;' language 'plpgsql' stable strict; + return v_member_p; +end;' language 'plpgsql'; -create or replace function contact__person_is_user_p (integer) -returns boolean as ' +-- create functions for organization_rels +select define_function_args('organization_rel__new','rel_id,rel_type;organization_rel,object_id_one,object_id_two,creation_user,creation_ip'); + +create or replace function organization_rel__new (integer,varchar,integer,integer,integer,varchar) +returns integer as ' declare - p_person_id alias for $1; - v_result boolean; + new__rel_id alias for $1; -- default null + rel_type alias for $2; -- default ''organization_rel'' + object_id_one alias for $3; + object_id_two alias for $4; + creation_user alias for $5; -- default null + creation_ip alias for $6; -- default null + v_rel_id integer; begin + v_rel_id := acs_rel__new ( + new__rel_id, + rel_type, + object_id_one, + object_id_two, + object_id_one, + creation_user, + creation_ip + ); - v_result := ''1'' from users where user_id = p_person_id; + return v_rel_id; + +end;' language 'plpgsql'; - if v_result then - return ''t''; - else - return ''f''; - end if; +-- function new +create or replace function organization_rel__new (integer,integer) +returns integer as ' +declare + object_id_one alias for $1; + object_id_two alias for $2; +begin + return organization_rel__new(null, + ''organization_rel'', + object_id_one, + object_id_two, + null, + null); +end;' language 'plpgsql'; -end;' language 'plpgsql' stable strict; +-- procedure delete +create or replace function organization_rel__delete (integer) +returns integer as ' +declare + rel_id alias for $1; +begin + PERFORM acs_rel__delete(rel_id); + + return 0; +end;' language 'plpgsql'; Fisheye: Tag 1.10.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/contacts-search-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/telecom-number-missing-plsql.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/views-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/sql/postgresql/views-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/address-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/address-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/tcl/attribute-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/attribute-procs-postgresql.xql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/contacts/tcl/attribute-procs-postgresql.xql 27 Feb 2005 17:07:18 -0000 1.3 +++ openacs-4/packages/contacts/tcl/attribute-procs-postgresql.xql 30 Nov 2005 15:31:01 -0000 1.3.2.1 @@ -1,122 +1,135 @@ - - - -postgresql7.2 - - - - select contact__attribute_create ( - null, - :widget_id, - :label, - :help_text, - :help_p, - :html, - :format, - now(), - :creation_user, - :creation_ip - ) - - - - - - - select contact__attribute_delete ( - :attribute_id - ) - - - - - - - select name from contact_attribute_names where attribute_id = :attribute_id and locale = :locale - - - - - - - select name from contact_view_names where attribute_id = :attribute_id and locale = :locale - - - - - - - select contact__attribute_value_save ( - :party_id, - :attribute_id, - :option_map_id, - :address_id, - :number_id, - :time, - :value, - :deleted_p, - now(), - :creation_user, - :creation_ip - ) - - - - - - - select postal_address__new ( - :additional_text, - null, - :country_code, - :delivery_address, - :municipality, - null, - :postal_code, - :postal_type, - :region, - :creation_user, - :creation_ip, - null - ) - - - - - - - select * from postal_addresses where address_id = :address_id - - - - - - - select telecom_number__new ( - :area_city_code, - :best_contact_time, - :extension, - :itu_id, - :location, - :national_number, - null, - null, - null, - :sms_enabled_p, - :subscriber_number, - :creation_user, - :creation_ip, - null - ) - - - - - - - select * from telecom_numbers where number_id = :number_id - - - - - + + + + + + + select contact__attribute_create ( + null, + :widget_id, + :label, + :help_text, + :help_p, + :html, + :format, + now(), + :creation_user, + :creation_ip + ) + + + + + + + select contact__attribute_delete ( + :attribute_id + ) + + + + + + + select name from contact_attribute_names where attribute_id = :attribute_id and locale = :locale + + + + + + + select name from contact_view_names where attribute_id = :attribute_id and locale = :locale + + + + + + + select contact__attribute_value_save ( + :party_id, + :attribute_id, + :option_map_id, + :address_id, + :number_id, + :time, + :value, + :deleted_p, + now(), + :creation_user, + :creation_ip + ) + + + + + + + select postal_address__new ( + :additional_text, + null, + :country_code, + :delivery_address, + :municipality, + null, + :postal_code, + :postal_type, + :region, + :creation_user, + :creation_ip, + null + ) + + + + + + + select * from postal_addresses where address_id = :address_id + + + + + + + select telecom_number__new ( + :area_city_code, + :best_contact_time, + :extension, + :itu_id, + :location, + :national_number, + null, + null, + null, + :sms_enabled_p, + :subscriber_number, + :creation_user, + :creation_ip, + null + ) + + + + + + + select * from telecom_numbers where number_id = :number_id + + + + + + select + distinct + a.pretty_name, + ot.attribute_id + from + ams_option_types ot, + ams_attributes a + where + ot.attribute_id = a.attribute_id + order by a.pretty_name asc + + + + Index: openacs-4/packages/contacts/tcl/attribute-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/attribute-procs.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/tcl/attribute-procs.tcl 13 Jan 2005 13:57:02 -0000 1.2 +++ openacs-4/packages/contacts/tcl/attribute-procs.tcl 30 Nov 2005 15:31:01 -0000 1.2.2.1 @@ -57,9 +57,17 @@ } + ad_proc -public options_attribute { + } { + Returns a list of only the attributes that have + multiple choices of the format {pretty_name attribute_id} + } { + set options [db_list_of_lists get_option_attributes { }] + lappend options [list "[_ contacts.Country]" "-1"] + lappend options [list "[_ contacts.Relationship]" "-2"] + return $options + } - - } Index: openacs-4/packages/contacts/tcl/category-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/category-procs-postgresql.xql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/contacts/tcl/category-procs-postgresql.xql 27 Feb 2005 17:07:18 -0000 1.3 +++ openacs-4/packages/contacts/tcl/category-procs-postgresql.xql 30 Nov 2005 15:31:01 -0000 1.3.2.1 @@ -1,31 +1,29 @@ - - - -postgresql7.2 - - - - SELECT - t.name as cat_name, - t.category_id as cat_id, - tm.tree_id, - tt.name as tree_name - FROM - category_tree_map tm, - categories c, - category_translations t, - category_tree_translations tt - WHERE - c.tree_id = tm.tree_id and - c.category_id = t.category_id and - tm.object_id = :package_id and - tm.tree_id = tt.tree_id and - c.deprecated_p = 'f' - ORDER BY - tt.name, - t.name - - - - - + + + + + + SELECT + t.name as cat_name, + t.category_id as cat_id, + tm.tree_id, + tt.name as tree_name + FROM + category_tree_map tm, + categories c, + category_translations t, + category_tree_translations tt + WHERE + c.tree_id = tm.tree_id and + c.category_id = t.category_id and + tm.object_id = :package_id and + tm.tree_id = tt.tree_id and + c.deprecated_p = 'f' + ORDER BY + tt.name, + t.name + + + + + Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-complaint-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-complaint-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-extend-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-extend-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-message-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-message-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.10.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.19.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-search-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.9.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contact-search-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.20.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/tcl/contacts-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-init.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/tcl/contacts-init.tcl 13 Jan 2005 13:57:02 -0000 1.2 +++ openacs-4/packages/contacts/tcl/contacts-init.tcl 30 Nov 2005 15:31:01 -0000 1.2.2.1 @@ -1,11 +1,117 @@ ad_library { - + Init file for contacts - + @author Matthew Geddert (openacs@geddert.com) @creation-date 2004-08-16 - @cvs-id $Id$ } -# set up contacts -contacts::view::init +if {[empty_string_p [info procs callback]]} { + + ns_log notice "CONTACTS: callback proc didn't exist so we are adding it here" + ad_proc -public callback { + -catch:boolean + {-impl *} + callback + args + } { + Placeholder for contacts to work on 5.1 + } { + } +} + + +if { [empty_string_p [info procs rel_types::create_role]] } { + + ns_log notice "CONTACTS: rel_types::create_role proc didn't exist so we are adding it here" + namespace eval rel_types {} + ad_proc -public rel_types::create_role { + {-pretty_name:required} + {-pretty_plural:required} + {-role} + } { + + Create a new Relationship Role + + @author Malte Sussdorff (sussdorff@sussdorff.de) + @creation-date 2005-06-04 + + @param pretty_name + + @param pretty_plural + + @param role + + @return 1 if successful + } { + if {![exists_and_not_null role]} { + set role [util_text_to_url \ + -text $pretty_name \ + -replacement "_" \ + -existing_urls [db_list get_roles {}]] + } + + set return_code 1 + + db_transaction { + + # Force internationalisation of Roles + + # Internationalising of Attributes. This is done by storing the + # attribute with it's acs-lang key + + set message_key "role_${role}" + + # Register the language keys + + lang::message::register en_US contacts $message_key $pretty_name + lang::message::register en_US contacts "${message_key}_plural" $pretty_plural + + # Replace the pretty_name and pretty_plural with the message key, so + # it is inserted correctly in the database + + set pretty_name "#contacts.${message_key}#" + set pretty_plural "#contacts.${message_key}_plural#" + db_exec_plsql create_role { + select acs_rel_type__create_role(:role, :pretty_name, :pretty_plural) + } + } on_error { + error $errmsg + set return_code 0 + } + return $return_code + } + + +} + + +if {[empty_string_p [info procs application_data_link::get_linked]]} { + + ns_log notice "CONTACTS: application_data_link::get_linked proc didn't exist so we are adding it here" + namespace eval application_data_link {} + ad_proc -public application_data_link::get_linked { + args + } { + Placeholder for contacts to work on 5.1 + } { + return {} + } + +} + +if {[empty_string_p [info procs application_link::get_linked]]} { + + ns_log notice "CONTACTS: application_link::get_linked proc didn't exist so we are adding it here" + namespace eval application_link {} + ad_proc -public application_link::get_linked { + args + } { + Placeholder for contacts to work on 5.1 + } { + return {} + } + +} + + Fisheye: Tag 1.16.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contacts-install-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.15.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/tcl/contacts-populate-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/tcl/contacts-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-procs-postgresql.xql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/contacts/tcl/contacts-procs-postgresql.xql 27 Feb 2005 17:07:18 -0000 1.3 +++ openacs-4/packages/contacts/tcl/contacts-procs-postgresql.xql 30 Nov 2005 15:31:01 -0000 1.3.2.1 @@ -1,372 +1,78 @@ -postgresql7.2 - - + - select 1 from contacts where party_id = :party_id + select name + from cr_items + where parent_id = :party_id - - + - select * from contacts where party_id = :party_id + select groups.group_id, + acs_objects.title as group_name, + ( select count(distinct gamm.member_id) from group_approved_member_map gamm where gamm.group_id = groups.group_id ) as member_count, + ( select count(distinct gcm.component_id) from group_component_map gcm where gcm.group_id = groups.group_id) as component_count, + CASE WHEN contact_groups.package_id is not null THEN '1' ELSE '0' END as mapped_p, + CASE WHEN default_p THEN '1' ELSE '0' END as default_p + from groups left join contact_groups on ( groups.group_id = contact_groups.group_id ), acs_objects + where groups.group_id not in ('-1','[contacts::default_group]') + and groups.group_id = acs_objects.object_id + and groups.group_id not in ( select gcm.component_id from group_component_map gcm where gcm.group_id != -1 ) + $filter_clause + order by mapped_p desc, CASE WHEN contact_groups.default_p THEN '000000000' ELSE upper(groups.group_name) END - - + - select * from contacts where party_id = :party_id + select groups.group_id, + groups.group_name, + ( select count(distinct gamm.member_id) from group_approved_member_map gamm where gamm.group_id = groups.group_id ) as member_count, + CASE WHEN package_id is not null THEN '1' ELSE '0' END as mapped_p, + CASE WHEN default_p THEN '1' ELSE '0' END as default_p + from groups left join contact_groups on ( groups.group_id = contact_groups.group_id ), group_component_map + where group_component_map.group_id = :group_id + and group_component_map.component_id = groups.group_id + order by upper(groups.group_name) - - + - select '1' from users where user_id = :party_id + select group_id + from group_component_map + where component_id = :group_id + and group_id != '-1' - - + - select nextval from acs_object_id_seq + select acs_group__new ( + :group_id, + 'group', + now(), + :creation_user, + :creation_ip, + :email, + :url, + :group_name, + :join_policy, + :context_id + ) - - + - select object_id from contact_object_types where object_type = 'organization' - - - - - - - select object_id from contact_object_types where object_type = 'person' - - - - - - - select * - from contact_attributes ca, - contact_widgets cw, - contact_attribute_object_map caom, - contact_attribute_names can - where caom.object_id = :object_id - and ca.attribute_id = can.attribute_id - and can.locale = :locale - and caom.attribute_id = ca.attribute_id - and ca.widget_id = cw.widget_id - and not ca.depreciated_p - and acs_permission__permission_p(ca.attribute_id,:user_id,'write') - order by caom.sort_order - - - - - - - - select ca.attribute_id, - ca.attribute, - cav.option_map_id, - cav.address_id, - cav.number_id, - to_char(cav.time,'YYYY MM DD') as time, - cav.value, - cav.value_format, - cw.storage_column - from contact_attributes ca, - contact_widgets cw, - contact_attribute_object_map caom left join - ( select * - from contact_attribute_values - where party_id = :party_id - and not deleted_p ) cav - on (caom.attribute_id = cav.attribute_id) - where caom.object_id = '$object_id' - and caom.attribute_id = ca.attribute_id - and ca.widget_id = cw.widget_id - and not ca.depreciated_p - and ( - cav.option_map_id is not null - or cav.address_id is not null - or cav.number_id is not null - or cav.value is not null - or cav.time is not null - or ca.attribute in ($custom_field_sql_list) - ) - and acs_permission__permission_p(ca.attribute_id,'$user_id','$permission') - order by caom.sort_order - - - - - - - select name - from organizations - where organization_id = :party_id - - - - - - - select legal_name - from organizations - where organization_id = :party_id - - - - - - - select reg_number - from organizations - where organization_id = :party_id - - - - - - - select first_names - from persons - where person_id = :party_id - - - - - - - select cao.option_id, cao.option - from contact_attribute_options cao, - organization_types ot, - organization_type_map otm - where cao.option = ot.type - and cao.attribute_id = :attribute_id - and otm.organization_type_id = ot.organization_type_id - and otm.organization_id = :party_id - - - - - - - select first_names - from persons - where person_id = :party_id - - - - - - - select last_name - from persons - where person_id = :party_id - - - - - - - select email - from parties - where party_id = :party_id - - - - - - - select url - from parties - where party_id = :party_id - - - - - - - select cao.option, cao.option_id - from contact_attribute_options cao, - contact_attribute_option_map caom - where caom.option_id = cao.option_id - and caom.option_map_id = :option_map_id - - - - - - select * - from contact_attributes ca, - contact_widgets cw, - contact_attribute_object_map caom, - contact_attribute_names can - where caom.object_id = :object_id - and ca.attribute_id = can.attribute_id - and can.locale = :locale - and caom.attribute_id = ca.attribute_id - and ca.widget_id = cw.widget_id - and not ca.depreciated_p - and acs_permission__permission_p(ca.attribute_id,:user_id,'write') - order by caom.sort_order - - - - - - - select cav.address_id as old_address_id - from contact_attribute_values cav, - postal_addresses pa - where cav.party_id = :party_id - and cav.attribute_id = :attribute_id - and not cav.deleted_p - and cav.address_id = pa.address_id - and pa.delivery_address = :delivery_address - and pa.municipality = :municipality - and pa.region = :region - and pa.postal_code = :postal_code - and pa.country_code = :country_code - - - - - - - select cav.number_id as old_number_id - from contact_attribute_values cav, - telecom_numbers tn - where cav.party_id = :party_id - and cav.attribute_id = :attribute_id - and not cav.deleted_p - and cav.number_id = tn.number_id - and tn.subscriber_number = :attribute_value_temp - - - - - - - select option_map_id - from contact_attribute_values - where party_id = :party_id - and attribute_id = :attribute_id and not deleted_p - - - - - - - select option_id - from contact_attribute_option_map - where option_map_id = :option_map_id - - - - - - - select nextval('contact_attribute_option_map_id_seq') as option_map_id - - - - - - - insert into contact_attribute_option_map - (option_map_id,party_id,option_id) + insert into contact_groups + (group_id,default_p,package_id) values - (:option_map_id,:party_id,:option_id) + (:group_id,:default_p,:package_id) - - - - update parties set email = :attribute_value_temp where party_id = :party_id - - - - - - - update parties set url = :attribute_value_temp where party_id = :party_id - - - - - - - update organizations set name = :attribute_value_temp where organization_id = :party_id - - - - - - - update organizations set legal_name = :attribute_value_temp where organization_id = :party_id - - - - - - - update organizations set reg_number = :attribute_value_temp where organization_id = :party_id - - - - - - - delete from organization_type_map where organization_id = :party_id - - - - - - - select organization_type_id - from contact_attribute_options cao, - organization_types ot - where cao.option = ot.type - and cao.option_id = :option_id - - - - - - - insert into organization_type_map - (organization_id, organization_type_id) - values - (:party_id, :organization_type_id) - - - - - - - update persons set first_names = :attribute_value_temp where person_id = :party_id - - - - - - - update persons set last_name = :attribute_value_temp where person_id = :party_id - - - - Index: openacs-4/packages/contacts/tcl/contacts-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-procs.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/tcl/contacts-procs.tcl 13 Jan 2005 13:57:05 -0000 1.2 +++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 30 Nov 2005 15:31:01 -0000 1.2.2.1 @@ -1,725 +1,728 @@ ad_library { - Support procs for the contacts package + Support procs for the contacts package @author Matthew Geddert openacs@geddert.com @creation-date 2004-07-28 @cvs-id $Id$ - } -namespace eval contact:: { +namespace eval contacts:: {} +namespace eval contact:: {} +namespace eval contact::util:: {} +namespace eval contact::group:: {} +namespace eval contact::revision:: {} +namespace eval contact::special_attributes:: {} +namespace eval contact::rels:: {} +namespace eval contact::employee {} - ad_proc -public name { - party_id - } { - this returns the contact's name - } { - return [contact::get::name $party_id] - } - ad_proc -public exists_p { - party_id - } { - this code returns 1 if the party_id exists - } { - return [db_0or1row exists_p {}] +ad_proc -public contacts::default_group { + {-package_id ""} +} { + returns the group_id for which this group is a component, if none then it return null +} { + if {[string is false [exists_and_not_null package_id]]} { + set package_id [ad_conn package_id] } +# return [db_string get_default_group {select group_id from contact_groups where package_id = :package_id and default_p} -default {}] +# return [db_string get_default_group {select group_id from +# application_groups where package_id = :package_id } -default {}] + return "-2" +} - ad_proc -public get { - party_id - } { - get the info on the contact - } { +ad_proc -private contact::util::generate_filename { + {-title:required} + {-extension:required} + {-existing_filenames ""} + {-party_id ""} +} { + Generate a pretty filename that relates to the title supplied - db_0or1row get_contact_info {} + @param party_id if supplied the filenames associated with this party will be used as existing_filenames if existing filenames is not provided - set contact_info [ns_set create] - ns_set put $contact_info party_id $party_id - ns_set put $contact_info object_type $object_type - ns_set put $contact_info name $name - ns_set put $contact_info legal_name $legal_name - ns_set put $contact_info reg_number $reg_number - ns_set put $contact_info first_names $first_names - ns_set put $contact_info last_name $last_name - ns_set put $contact_info sort_first_names $sort_first_names - ns_set put $contact_info sort_last_name $sort_last_name - ns_set put $contact_info email $email - ns_set put $contact_info url $url - ns_set put $contact_info user_p $user_p - - # Now, set the variables in the caller's environment - ad_ns_set_to_tcl_vars -level 2 $contact_info - ns_set free $contact_info - + @param existing_filenames a list of filenames that the generated filename must not be equal to +} { + if {[exists_and_not_null party_id] + && [string is integer $party_id] && ![exists_and_not_null existing_filenames]} { + set existing_filenames [db_list get_parties_existing_filenames {}] } + set filename [util_text_to_url \ + -text ${title} -replacement "_"] + set output_filename "${filename}.${extension}" + set num 1 + while {[lsearch $existing_filenames $output_filename] >= 0} { + set output_filename "${filename}${num}.${extension}" + incr num + } + return $output_filename +} - - +ad_proc -private contact::util::get_file_extension { + {-filename:required} +} { + get the file extension from a file +} { + return [lindex [split $filename "."] end] } -namespace eval contact::get:: { - - ad_proc -public array { - party_id - array + ad_proc -public contact::util::get_employees { + {-organization_id:required} +} { + get employees of an organization +} { + set contact_list {} + db_foreach select_employee_ids { + select CASE WHEN object_id_one = :organization_id + THEN object_id_two + ELSE object_id_one END as other_party_id + from acs_rels, acs_rel_types + where acs_rels.rel_type = acs_rel_types.rel_type + and ( object_id_one = :organization_id or object_id_two = :organization_id ) + and acs_rels.rel_type = 'contact_rels_employment' } { - get the info from addresses - } { - upvar $array row - db_0or1row select_address_info {} -column_array row + lappend contact_list $other_party_id } + return $contact_list +} - ad_proc -public object_type { - party_id - } { - returns the parties object_type - } { - contact::get $party_id - return $object_type - } +ad_proc -public contact::util::get_employers { + {-employee_id:required} +} { + Get employers of an employee - ad_proc -public name { - party_id + @author Al-Faisal El-Dajani (faisal.dajani@gmail.com) + @param employee_id The ID of the employee whom you want to know his/her employer + @creation-date 2005-10-17 + @return List of lists, each containing the ID and name of an employer, or an empty list if no employers exist. +} { + set contact_list [list] + db_foreach select_employer_ids { + select CASE WHEN object_id_one = :employee_id + THEN object_id_two + ELSE object_id_one END as other_party_id + from acs_rels, acs_rel_types + where acs_rels.rel_type = acs_rel_types.rel_type + and ( object_id_one = :employee_id or object_id_two = :employee_id ) + and acs_rels.rel_type = 'contact_rels_employment' } { - returns the parties sort_first_names - } { - contact::get $party_id - return $sort_first_names + set organization_name [contact::name -party_id $other_party_id] + lappend contact_list [list $other_party_id $organization_name] } - ad_proc -public custom_field_list { - party_id - } { - set custom_field_list [list email url] - set object_type [contact::get::object_type $party_id] - if { $object_type == "organization" } { - lappend custom_field_list "organization_type" - lappend custom_field_list "organization_name" - lappend custom_field_list "legal_name" - lappend custom_field_list "reg_number" - } - if { $object_type == "person" } { - lappend custom_field_list "first_names" - lappend custom_field_list "last_name" - } - return $custom_field_list + return $contact_list } +ad_proc -public contact::employee::get { + {-employee_id:required} + {-array:required} + {-organization_id} +} { + Get full employee information. If employee does not have a phone number, fax number, or an e-mail address, the employee will be assigned the corresponding employer value, if an employer exists. + @author Al-Faisal El-Dajani (faisal.dajanim@gmail.com) + @creation-date 2005-10-18 + @param employee_id The ID of the employee whose information you wish to retrieve. + @param array Name of array to upvar contents into. + @param organization_id ID of the organization whose information should be returned if the employee_id is an employee at this organization. If not specified, defaults to first employer relationship found, if any. + @return 1 if user exists, 0 otherwise. +} { + ns_log notice "start processing" + upvar $array local_array + set employer_exist_p 0 + set employee_attributes [list "first_names" "last_name" "salutation" "person_title" "home_phone" "private_fax" "email"] + set employer_attributes [list "name" "company_phone" "company_fax" "email"] -} - - - -namespace eval contacts::util:: { - - ad_proc -public party_is_user_p { - party_id - } { - returns 1 if the party is a user and 0 if not - } { - return [db_0or1row get_party_is_user_p {} ] + # Check if ID belongs to an employee, if not return 0 + if {![person::person_p -party_id $employee_id]} { + ns_log notice "The ID specified does not belong to an employee" + return 0 } + # Get employers, if any + set employers [list] + set employers [contact::util::get_employers -employee_id $employee_id] - ad_proc -public next_object_id { - } { - returns the next available object_id - } { - db_1row get_next_object_id {} - return $nextval + # If employer(s) exist + if {[llength $employers] > 0} { + if {[exists_and_not_null organization_id]} { + # If user sepcified to get information for a certain employer, check if the specified employer exists. If employer specified is not an employer, no organization info will be returned. + foreach single_employer $employers { + if {$organization_id == [lindex $single_employer 0]} { + set employer $single_employer + set employer_exist_p 1 + break + } + } + } else { + # If user didn't specify a certain employer, get first employer. + set employer [lindex $employers 0] + set employer_exist_p 1 + } + # Get best/last revision + set employee_id [content::item::get_best_revision -item_id $employee_id] + set employer_id [content::item::get_best_revision -item_id [lindex $employer 0]] } - - ad_proc -public organization_object_id { - } { - returns the object_id of the organization contact_object_type - } { - db_1row get_organization_object_id {} - return $object_id + # Set the attributes + foreach attribute $employee_attributes { + set value [ams::value \ + -object_id $employee_id \ + -attribute_name $attribute + ] + set local_array($attribute) $value } + if {$employer_exist_p} { + foreach attribute $employer_attributes { + set value [ams::value \ + -object_id $employer_id \ + -attribute_name $attribute + ] + set $attribute $value + } - ad_proc -public person_object_id { - } { - returns the object_id of the organization contact_object_type - } { - db_1row get_object_id {} - return $object_id + # Check if employee email, phone, and fax exist. If not, set them to employer values. + if {![exists_and_not_null $local_array(email)]} { + set local_array(email) $email + } + if {![exists_and_not_null $local_array(home_phone)]} { + set local_array(home_phone) $company_phone + } + if {![exists_and_not_null $local_array(private_fax)]} { + set local_array(private_fax) $company_fax + } } - - # some of this codes was borrowed from the directory module - ad_proc -public letter_bar { - {-export_vars ""} - {-letter ""} - {-initial_list:required} - } { - Returns an A-Z bar with greyed out letters not - in initial_list and bolds "letter". - - Includes all existing url vars except those in - the "excluded_vars" list. - } { - set all_letters [list A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] - - set html_list [list] - foreach l $all_letters { - if { [lsearch -exact $initial_list $l] == -1 } { - # This means no user has this initial - lappend html_list "$l" - } elseif { [string compare $l $letter] == 0 } { - lappend html_list "$l" - } else { - lappend html_list "$l" - } - } - if { [empty_string_p $letter] || [string compare $letter "all"] == 0 } { - lappend html_list "\#contacts.All\#" - } else { - lappend html_list "\#contacts.All\#" - } - return "[join $html_list " | "]" - } - - ad_proc -public sqlify_list { - variable_list + set local_array(company_name) $name + set address_id [attribute::id -object_type "organization" -attribute_name "company_address"] + contacts::postal_address::get -address_id $address_id -array address_array + set local_array(company_address) $address_array(delivery_address) + set local_array(company_municipality) $address_array(municipality) + set local_array(company_region) $address_array(region) + set local_array(company_postal_code) $address_array(postal_code) + set local_array(company_country_code) $address_array(country_code) + + return 1 +} + +ad_proc -public contact::util::get_employee_organization { + {-employee_id:required} +} { + get organization of an employee +} { + set contact_list {} + db_foreach select_employee_ids { + select CASE WHEN object_id_one = :employee_id + THEN object_id_two + ELSE object_id_one END as other_party_id + from acs_rels, acs_rel_types + where acs_rels.rel_type = acs_rel_types.rel_type + and ( object_id_one = :employee_id or object_id_two = :employee_id ) + and acs_rels.rel_type = 'contact_rels_employment' } { - set output_list {} - foreach item $variable_list { - if { [exists_and_not_null output_list] } { - append output_list ", " - } - append output_list "'$item'" - } - return $output_list + lappend contact_list $other_party_id } - + return $contact_list } +ad_proc -private contact::flush { + {-party_id:required} +} { + Flush memorized information related to this contact +} { + util_memoize_flush "::contact::email_address_exists_p_not_cached -party_id $party_id" + util_memoize_flush "::contact::mailing_address_exists_p_not_cached -party_id $party_id" + util_memoize_flush "::contact::name_not_cached -party_id $party_id" + util_memoize_flush "::contact::email_not_cached -party_id $party_id" +} +ad_proc -public contact::name { + {-party_id:required} +} { + this returns the contact's name. Cached +} { + return [util_memoize [list ::contact::name_not_cached -party_id $party_id]] +} -namespace eval contacts::get { +ad_proc -public contact::name_not_cached { + {-party_id:required} +} { + this returns the contact's name +} { + if {[person::person_p -party_id $party_id]} { + set person_info [person::name -person_id $party_id] + return $person_info + } else { + # if there is an org the name is returned otherwise we search for a grou, + # if there is no group null is returned + set name [db_string get_org_name {select name from organizations where organization_id = :party_id} -default ""] + if { [empty_string_p $name] } { + set name [db_string get_group_name {select group_name from groups where group_id = :party_id} -default {}] + } else { + return $name + } - ad_proc -public ad_form_elements { - object_id - party_id - } { - this code lists the form elements for a contact (after checking whether or not the user has permission to edit/add this info) - } { + } +} +ad_proc -public contact::email { + {-party_id:required} +} { + this returns the contact's name. Cached +} { + return [util_memoize [list ::contact::email_not_cached -party_id $party_id]] +} - set locale [lang::conn::locale -site_wide] - set user_id [ad_conn user_id] +ad_proc -public contact::email_not_cached { + {-party_id:required} +} { + this returns the contact's name +} { + set email [db_string get_party_email { select email from parties where party_id = :party_id } -default {}] + if { ![exists_and_not_null email] } { + # we check if these is an ams_attribute_valued email address for this party + set attribute_id [contact::email_attribute_id] + set revision_id [contact::live_revision -party_id $party_id] + if { [exists_and_not_null revision_id] } { + set email [db_string get_email { select ams_attribute_value__value(:attribute_id,value_id) from ams_attribute_values where object_id = :revision_id and attribute_id = :attribute_id } -default {}] + set email [ams::widget -widget email -request value_text -value $email] + } + } + return $email +} - set active_group_id "" +ad_proc -private contact::email_attribute_id { +} { + this returns the email attributes attribute_id. cached +} { + return [util_memoize [list ::contact::email_attribute_id]] +} - set element_list "" - if { [string is true [contact::exists_p $party_id]] } { - set object_type [contact::get::object_type $party_id] - } else { - # since the party doesn't exist yet, we assume that - # contacts is calling this proc to create a person - # or an organization - if { $object_id == [contacts::util::organization_object_id] } { - set object_type "organization" - } else { - set object_type "person" - } - } - db_foreach select_attributes {} { +ad_proc -private contact::email_attribute_id { +} { + this returns the email attributes attribute_id +} { + return [db_string get_email_attribute_id { select attribute_id from acs_attributes where object_type = 'party' and attribute_name = 'email'}] +} - if { [lsearch [list first_names last_name email url] $attribute] >= 0 } { - if { [contacts::util::party_is_user_p $party_id] } { - if { ![string compare $party_id [ad_conn user_id]] } { - set help_text "This will change your account info." - } elseif { [acs_user::site_wide_admin_p] } { - set help_text "This will change [person::name -person_id $party_id]'s account info." - } else { -# set help_text "You may not edit this information since [person::name -person_id $party_id] is a user of this system." - set widget "inform" - } - } - } +ad_proc -public contact::link { + {-party_id:required} +} { + this returns the contact's name. Cached +} { + set contact_name [contact::name -party_id $party_id] + if { ![empty_string_p $contact_name] } { + set contact_url [contact::url -party_id $party_id] + return "${contact_name}" + } else { + return {} + } +} - if { [contacts::util::party_is_user_p $party_id] && ![string compare $attribute "email"] } { - set required_p 1 - } - if { $object_type == "person" } { - if { [lsearch [list first_names last_name] $attribute] >= 0 } { - set required_p 1 - } - } - if { $object_type == "organization" } { - if { [lsearch [list organization_name organization_type] $attribute] >= 0 } { - set required_p 1 - } - } +ad_proc -public contact::type { + {-party_id:required} +} { + returns the contact type +} { + if {[contact::user_p -party_id $party_id]} { + return "user" + } elseif {[person::person_p -party_id $party_id]} { + return "person" + } elseif {[organization::organization_p -party_id $party_id]} { + return "organization" + } else { + return "" + } +} +ad_proc -public contact::exists_p { + {-party_id:required} +} { + does this contact exist? +} { + # persons can be organizations so we need to do the check this way + if {[person::person_p -party_id $party_id]} { + return 1 + } elseif {[organization::organization_p -party_id $party_id]} { + return 1 + } else { + return 0 + } +} +ad_proc -public contact::user_p { + {-party_id:required} +} { + is this party a user? Cached +} { + return [util_memoize [list ::contact::user_p_not_cached -party_id $party_id]] +} +ad_proc -public contact::user_p_not_cached { + {-party_id:required} +} { + is this party a person? Cached +} { + if {[db_0or1row contact_user_exists_p {select '1' from users where user_id = :party_id}]} { + return 1 + } else { + return 0 + } +} +ad_proc -public contact::url { + {-party_id:required} +} { + create a contact revision +} { + return "[apm_package_url_from_id [apm_package_id_from_key "contacts"]]$party_id/" +} +ad_proc -public contact::revision::new { + {-party_id:required} + {-party_revision_id ""} +} { + create a contact revision +} { + set extra_vars [ns_set create] + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {party_id party_revision_id} + return [package_instantiate_object \ + -extra_vars $extra_vars contact_party_revision] +} - set widget_string "contact_attribute__$attribute\:$datatype\($widget\)" +ad_proc -public contact::live_revision { + {-party_id:required} +} { + create a contact revision +} { + if {[db_0or1row revision_exists_p {select 1 from cr_items where item_id = :party_id}]} { + return [item::get_live_revision $party_id] + } else { + return "" + } +} +ad_proc -public contact::subsite_user_group { + {-party_id:required} +} { + create a contact revision +} { + if {[db_0or1row revision_exists_p {select 1 from cr_items where item_id = :party_id}]} { + return [item::get_live_revision $party_id]} else { + return "" + } +} - if { ![exists_and_not_null required_p] } { - append widget_string ",optional" - } else { - if { [string is false $required_p] } { - append widget_string ",optional" - } - } - if { [exists_and_not_null multiple_p] } { - if { [string is true $multiple_p] } { - append widget_string ",multiple" - } - } +ad_proc -private contact::person_upgrade_to_user { + {-person_id ""} +} { + Upgrade a person to a user. This proc does not send an email to the newly created user. +} { + contact::flush -party_id $person_id + set user_id $person_id + set username [contact::email -party_id $person_id] + set authority_id [auth::authority::local] - if { [exists_and_not_null nospell_p] } { - if { [string is true $nospell_p] } { - append widget_string ",nospell" - } - } + # Make sure that we do not upgrade an already existing user + if {![contact::user_p -party_id $person_id]} { + db_transaction { + db_dml upgrade_user {update acs_objects set object_type = 'user' where object_id = :user_id; + + insert into users + (user_id, authority_id, username, email_verified_p) + values + (:user_id, :authority_id, :username, 't'); + + } + # Make sure that we we did not store user preferences before + if {![db_string user_prefs_p "select 1 from user_preferences where user_id = :user_id" -default "0"]} { + db_dml update_user_prefs {insert into user_preferences + (user_id) + values + (:user_id); + } + } + + # we reset the password in admin mode. this means that an email + # will not automatically be sent. + auth::password::reset -authority_id [auth::authority::local] -username $username -admin + group::add_member \ + -group_id "-2" \ + -user_id $person_id \ + -rel_type "membership_rel" + + # Grant the user to update the password on himself + permission::grant -party_id $user_id -object_id $user_id -privilege write - set temp_element [list $widget_string [list "label" "$name"]] + return 1 + } on_error { + error "There was an error in contact::person_upgrade_to_user: $errmsg" + return 0 + } + } +} - if { $storage_column == "option_map_id" } { - lappend temp_element [list "options" [db_list_of_lists select_element_options { - select option, option_id - from contact_attribute_options - where attribute_id = :attribute_id - order by sort_order - } ]] - } +ad_proc -private contact::group::new { + {-group_id ""} + {-email ""} + {-url ""} + -group_name:required + {-join_policy "open"} + {-context_id:required} +} { + this creates a new group for use with contacts (and the permissions system) +} { + set creation_user [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + set group_name [lang::util::convert_to_i18n -prefix "group" -text "$group_name"] - if { [exists_and_not_null help_p] } { - if { [string is true $help_p] } { - lappend temp_element "help" - } - } + return [db_string create_group {}] +} - if { [exists_and_not_null help_text] } { - lappend temp_element [list "help_text" $help_text] - } +ad_proc -public contact::group::map { + -group_id:required + {-package_id ""} + {-default_p "f"} +} { + this creates a new group for use with contacts (and the permissions system) +} { + if {[empty_string_p $package_id]} { + set package_id [ad_conn package_id] + } + db_dml map_group {} +} - if { $datatype == "date" && [exists_and_not_null format] } { - lappend temp_element [list "format" "$format"] - } +ad_proc -public contact::group::parent { + -group_id:required +} { + returns the group_id for which this group is a component, if none then it return null +} { + return [db_string get_parent {} -default {}] +} - if { [exists_and_not_null html] } { - set temp_html "" - foreach element [lrange $html 0 [llength $html]] { - lappend temp_html "[lindex $element 0]" - } - if { [exists_and_not_null temp_html] } { - lappend temp_element [list "html" $temp_html] - } - } +ad_proc -public contact::groups { + {-expand "all"} + {-indent_with "..."} + {-privilege_required "read"} + {-output "list"} + {-all:boolean} + {-no_member_count:boolean} +} { +} { + set user_id [ad_conn user_id] + set group_list [list] + # Filter clause + # set filter_clause "" + set filter_clause "and groups.group_id not in (select community_id from dotlrn_communities_all)" + db_foreach get_groups {} { + # We check if the group has the required privilege + # specified on privilege_required switch, if not then + # we just simple continue with the next one + if { ![permission::permission_p -object_id $group_id -party_id $user_id -privilege $privilege_required] } { + continue + } - if { [exists_and_not_null heading] } { - lappend temp_element [list "section" "$heading"] + if { $mapped_p || $all_p} { + lappend group_list [list [lang::util::localize $group_name] $group_id $member_count "1" $mapped_p $default_p] + if { $component_count > 0 && ( $expand == "all" || $expand == $group_id ) } { + db_foreach get_components {} { + if { $mapped_p || $all_p} { + lappend group_list [list "$indent_with$group_name" $group_id $member_count "2" $mapped_p $default_p] + } + } } - - lappend element_list "$temp_element" } - - return $element_list } + set group_list [ams::util::localize_list_of_lists -list $group_list] - - - - - ad_proc -public ad_form_values { - object_id - party_id - } { - get the attribute_values for a contact - } { - - if { [string is true [contact::exists_p $party_id]] } { - set user_id [ad_conn user_id] - - - contacts::get::values::multirow -multirow_name "ad_form_values" -party_id $party_id -object_id $object_id -permission "write" - - - set courses_info_set [ns_set create] - - template::multirow -unclobber foreach ad_form_values { - ns_set put $courses_info_set contact_attribute__$attribute_name $ad_form_value + switch $output { + list { + set list_output [list] + foreach group $group_list { + if {$no_member_count_p} { + lappend list_output [list [lindex $group 0] [lindex $group 1]] + } else { + lappend list_output [list [lindex $group 0] [lindex $group 1] [lindex $group 2]] + } } - - # Now, set the variables in the caller's environment - ad_ns_set_to_tcl_vars -level 2 $courses_info_set - ns_set free $courses_info_set - + return $list_output } + ad_form { + set ad_form_output [list] + foreach group $group_list { + lappend ad_form_output [list [lindex $group 0] [lindex $group 1]] + } + return $ad_form_output + } + default { + return $group_list + } } - - - } +ad_proc -public contact::special_attributes::ad_form_values { + -party_id:required + -form:required +} { +} { + set object_type [contact::type -party_id $party_id] -namespace eval contacts::get::values:: { + db_1row get_extra_info { + select email, url + from parties + where party_id = :party_id} + set element_list [list email url] - ad_proc multirow { - {-multirow_name} - {-permission "read"} - {-object_id} - {-party_id} - {-orderby "sort_order,asc"} - } { - Returns a multirow - } { - - set user_id [ad_conn user_id] - - template::multirow create $multirow_name attribute_name attribute_id pretty_attribute_name ad_form_value pretty_value pretty_value_html sort_order sort_key - - set custom_field_list [contact::get::custom_field_list $party_id] - set custom_field_sql_list [contacts::util::sqlify_list $custom_field_list] + if { [lsearch [list person user] $object_type] >= 0 } { - set sort_order "0" + array set person [person::get -person_id $party_id] + set first_names $person(first_names) + set last_name $person(last_name) - db_foreach select_attribute_values "" { - - set attribute_name $attribute - set attribute_id $attribute_id - set pretty_attribute_name [contacts::attribute::name $attribute_id] - - if { [lsearch $custom_field_list $attribute] >= 0 } { - - if { $attribute == "organization_name" } { - set ad_form_value [db_string organization_name_from_party_id {} -default {}] - set pretty_value $ad_form_value - } - if { $attribute == "organization_type" } { - set ad_form_value [list] - set pretty_value {} - db_foreach organization_types_from_party_and_attribute_id {} { - if { [llength $ad_form_value] > 0 } { - append pretty_value "\n" - } - lappend ad_form_value $option_id - append pretty_value $option - } - } - if { $attribute == "legal_name" } { - set ad_form_value [db_string legal_name_from_party_id {} -default {}] - set pretty_value $ad_form_value - } - if { $attribute == "reg_number" } { - set ad_form_value [db_string reg_number_from_party_id {} -default {}] - set pretty_value $ad_form_value - } - if { $attribute == "first_names" } { - set ad_form_value [db_string first_names_from_party_id {} -default {}] - set pretty_value $ad_form_value - } - if { $attribute == "last_name" } { - set ad_form_value [db_string last_name_from_party_id {} -default {}] - set pretty_value $ad_form_value - } - if { $attribute == "email" } { - set ad_form_value [db_string email_from_party_id {} -default {}] - set pretty_value $ad_form_value - } - if { $attribute == "url" } { - set ad_form_value [db_string url_from_party_id {} -default {}] - set pretty_value $ad_form_value - } - - } else { - - set pretty_value $value - set ad_form_value $value - - if { $storage_column == "address_id" } { - contacts::postal_address::get -address_id "$address_id" -array "address_info" - set ad_form_value [list $address_info(delivery_address) $address_info(municipality) $address_info(region) $address_info(postal_code) $address_info(country_code)] - set pretty_value "$address_info(delivery_address)\n$address_info(municipality), $address_info(region) $address_info(postal_code)\n$address_info(country_code)" - } - if { $storage_column == "number_id" && [exists_and_not_null number_id] } { - contacts::telecom_number::get -number_id $number_id -array "telecom_info" - set ad_form_value $telecom_info(subscriber_number) - set pretty_value $telecom_info(subscriber_number) - } - if { $storage_column == "time" && [exists_and_not_null time] } { - set ad_form_value $time - set pretty_value $time - } - if { $storage_column == "option_map_id" && [exists_and_not_null option_map_id] } { - set pretty_value {} - set ad_form_value [list] - db_foreach select_options_from_map {} { - if { [llength $ad_form_value] > 0 } { - # we know there has been a previous entry so we can put in a comma - append pretty_value "\n" - } - append pretty_value $option - lappend ad_form_value $option_id - } - } - - } - if { [exists_and_not_null ad_form_value] || [exists_and_not_null pretty_value] } { - incr sort_order - set pretty_value_html [ad_convert_to_html $pretty_value] - template::multirow append $multirow_name $attribute_name $attribute_id $pretty_attribute_name $ad_form_value $pretty_value $pretty_value_html $sort_order - } - - } + lappend element_list first_names last_name + } elseif {$object_type == "organization" } { - set orderby [split $orderby ","] - set orderby_field [lindex $orderby 0] - if { [lindex $orderby 1] == "asc" } { - set orderby_direction {-increasing} - } else { - set orderby_direction {-decreasing} - } - template::multirow sort $multirow_name -dictionary $orderby_direction $orderby_field - + db_0or1row get_org_info { + select name, legal_name, reg_number, notes + from organizations + where organization_id = :party_id} + lappend element_list name legal_name reg_number notes } - - + + foreach element $element_list { + if {[exists_and_not_null $element]} { + if {[template::element::exists $form $element]} { + template::element::set_value $form $element [set $element] + } + } + } } - -namespace eval contacts::save::ad_form { - - ad_proc -public values { - object_id - party_id - - } { - this code saves attributes input in a form - } { - - set user_id [ad_conn user_id] - - if { [exists_and_not_null party_id] } { - if { ![contact::exists_p $party_id] } { - set party_id [contacts::contact::create -party_id $party_id] - } - } else { - set party_id [contacts::contact::create] +ad_proc -public contact::special_attributes::ad_form_save { + -party_id:required + -form:required +} { +} { + set object_type [contact::type -party_id $party_id] + set element_list [list email url] + if { [lsearch [list person user] $object_type] >= 0 } { + lappend element_list first_names last_name + } elseif {$object_type == "organization" } { + lappend element_list name legal_name reg_number notes + } + foreach element $element_list { + if {[template::element::exists $form $element]} { + set value [template::element::get_value $form $element] + switch $element { + email { + if {[db_0or1row party_is_user_p {select '1' from users where user_id = :party_id}]} { + if {[exists_and_not_null value]} { + set username $value + } else { + set username $party_id + } + acs_user::update -user_id $party_id -username $username + } + party::update -party_id $party_id -email $value -url [db_string get_url {select url from parties where party_id = :party_id} -default {}] + } + url { + party::update -party_id $party_id -email [db_string get_email {select email from parties where party_id = :party_id} -default {}] -url $value + } + default { + set $element $value + } + } } - + } + if { [lsearch [list person user] $object_type] >= 0 } { - set locale [lang::conn::locale -site_wide] + # first_names and last_name are required - set object_type [contact::get::object_type $party_id] + if {[exists_and_not_null first_names] + && [exists_and_not_null last_name]} { + person::update -person_id $party_id -first_names $first_names -last_name $last_name + } else { + if {![exists_and_not_null first_names]} { + error "The object type was person but first_names (a required element) did not exist" + } + if {![exists_and_not_null last_name]} { + error "The object type was person but first_names (a required element) did not exist" + } + } + } elseif {$object_type == "organization" } { - set attr_value_temp "" + # name is required - db_foreach select_attributes {} { - - set attribute_value_temp [string trim [template::element::get_value entry "contact_attribute__$attribute"]] - - if { $storage_column == "address_id" } { - - # I need to verify that something has changed here - - set delivery_address [string trim [template::util::address::get_property delivery_address $attribute_value_temp]] - set municipality [string trim [template::util::address::get_property municipality $attribute_value_temp]] - set region [string trim [template::util::address::get_property region $attribute_value_temp]] - set postal_code [string trim [template::util::address::get_property postal_code $attribute_value_temp]] - set country_code [string trim [template::util::address::get_property country_code $attribute_value_temp]] - - - set old_address_id "" - db_0or1row select_old_address_id {} - if { [exists_and_not_null old_address_id] } { - # the address in the database is the same - set address_id $old_address_id - } else { - # the address in the database is different so we need to add one - if { [exists_and_not_null delivery_address] && [exists_and_not_null country_code] } { - set address_id [contacts::postal_address::new \ - -delivery_address $delivery_address \ - -municipality $municipality \ - -region $region \ - -postal_code $postal_code \ - -country_code $country_code ] - } else { - set address_id "" - } - } - - contacts::attribute::value::save \ - -attribute_id $attribute_id \ - -party_id $party_id \ - -address_id $address_id - - } - if { $storage_column == "number_id" } { - - set old_number_id "" - db_0or1row select_old_number_id {} - if { [exists_and_not_null old_number_id] } { - # the number in the database is the same - set number_id $old_number_id - } else { - # the telecom_number in the database is different so we need to add one - if { [exists_and_not_null attribute_value_temp] } { - set number_id [contacts::telecom_number::new -subscriber_number $attribute_value_temp ] - } else { - set number_id "" - } - } - - contacts::attribute::value::save \ - -attribute_id $attribute_id \ - -party_id $party_id \ - -number_id $number_id - } - if { $storage_column == "option_map_id" } { - - set attribute_value_temp [string trim [template::element::get_values entry "contact_attribute__$attribute"]] - - if { [exists_and_not_null attribute_value_temp] } { - - # first we verify that the address has changed. otherwise we pass on the old option_map_id - db_0or1row get_option_map_id {} + if {[exists_and_not_null name]} { + if {![exists_and_not_null legal_name]} {set legal_name "" } + if {![exists_and_not_null reg_number]} {set reg_number "" } + if {![exists_and_not_null notes]} {set notes "" } + db_dml update_org { + update organizations + set name = :name, + legal_name = :legal_name, + reg_number = :reg_number, + notes = :notes + where organization_id = :party_id} + } else { + error "The object type was organization but name (a required element) did not exist" + } + } +} - if { [exists_and_not_null option_map_id] } { - # we know that a previous entry exists +ad_proc -public contacts::get_values { + {-attribute_name ""} + {-group_name ""} + {-group_id ""} + {-contacts_package_id ""} + {-party_id:required} + {-object_type:required} +} { + If attribute_name is provided return the value of the attribute for the party, otherwise return an array with all elements for this party - set old_option_ids "" - db_foreach get_old_options {} { - lappend old_option_ids $option_id - } - set new_option_ids $attribute_value_temp + @author Malte Sussdorff (sussdorff@sussdorff.de) + @creation-date 2005-06-09 - set same_count 0 - foreach option_id $old_option_ids { - if {![empty_string_p $option_id]} { - if { [regsub -all $option_id $new_option_ids $option_id new_option_ids] } { - incr same_count - } - } - } - if { [llength $new_option_ids] == $same_count && [llength $old_option_ids] == $same_count } { - # the lists have the same values - do nothing - } else { - # the lists are different - db_1row get_new_option_map_id {} + @param attribute_name If attribute name is provided, return the value of the attribute for the user. Otherwise return an array with all attributes. - foreach option_id $attribute_value_temp { - if {![empty_string_p $option_id]} { - db_dml insert_options_map {} - } - } - } - } else { - # there is no previous entry in the database - db_1row get_new_option_map_id {} + @param group_name Name of the group that contains the value of the attribute (e.g. #acs-kernel.Registered_Users) - foreach option_id $attribute_value_temp { - if {![empty_string_p $option_id]} { - db_dml insert_options_map { - insert into contact_attribute_option_map - (option_map_id,party_id,option_id) - values - (:option_map_id,:party_id,:option_id) - } - } - } - } - - set attribute_value_temp $option_map_id - } - - contacts::attribute::value::save \ - -attribute_id $attribute_id \ - -party_id $party_id \ - -option_map_id $attribute_value_temp - } - if { $storage_column == "time" } { - contacts::attribute::value::save \ - -attribute_id $attribute_id \ - -party_id $party_id \ - -time [contacts::date::sqlify -date $attribute_value_temp] - } - if { $storage_column == "value" } { - contacts::attribute::value::save \ - -attribute_id $attribute_id \ - -party_id $party_id \ - -value $attribute_value_temp - } - + @param group_id Instead of group_name you can specify the group_id directly + @param contacts_package_id The package_id of the contacts package that contains the element. - - - set custom_fields [list organization_name legal_name reg_number organization_type first_names last_name email url] - - if { [lsearch $custom_fields $attribute] >= 0 } { - if { $attribute == "email" } { - db_dml update_parties_email {} - } - if { $attribute == "url" } { - db_dml update_parties_url {} - } - if { $object_type == "organization" } { - # [list organization_name legal_name reg_number organization_type] - if { $attribute == "organization_name" } { - db_dml update_organizations_name {} - } - if { $attribute == "legal_name" } { - db_dml update_organizations_legal_name {} - } - if { $attribute == "reg_number" } { - db_dml update_organizations_reg_number {} - } - if { $attribute == "organization_type" } { - db_dml delete_org_type_maps {} - set attribute_value_temp [string trim [template::element::get_values entry "contact_attribute__$attribute"]] - foreach option_id $attribute_value_temp { - if {![empty_string_p $option_id]} { - db_1row get_organization_type_id {} - - - db_dml insert_mapping {} - } - } - } - } - if { $object_type == "person" } { - # [list first_names last_name] - if { $attribute == "first_names" } { - db_dml update_persons_first_names {} - } - if { $attribute == "last_name" } { - db_dml update_persons_last_name {} - } - - - } - - - } - - - - - - - - - } + @return - return $party_id + @error +} { + if {[empty_string_p $contacts_package_id]} { + set contacts_package_id [ad_conn package_id] } + if {[empty_string_p $group_id]} { + if {![db_0or1row get_group_id "select group_id from groups where group_name = :group_name"]} { + ad_return_error "ERROR" "[_ contacts.lt_Unable_to_retrieve_gr]" + } + } + + set list_name "${contacts_package_id}__${group_id}" + set revision_id [contact::live_revision -party_id $party_id] + set values [ams::values -package_key "contacts" -object_type $object_type -list_name $list_name -object_id $revision_id] + array set return_array [list] + # Never forget to localize the values retrieved from ams. + foreach {section attribute pretty_name value} $values { + set return_array($attribute) [lang::util::localize $value] + } + + if {![empty_string_p $attribute_name]} { + return $return_array($attribute_name) + } else { + return [array get return_array] + } } Index: openacs-4/packages/contacts/tcl/view-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/Attic/view-procs-postgresql.xql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/contacts/tcl/view-procs-postgresql.xql 27 Feb 2005 17:07:18 -0000 1.3 +++ openacs-4/packages/contacts/tcl/view-procs-postgresql.xql 30 Nov 2005 15:31:01 -0000 1.3.2.1 @@ -1,87 +1,85 @@ - - - -postgresql7.2 - - - - select sort_order - from contact_views - where contact_object_type = :contact_object_type - order by sort_order desc limit 1 - - - - - - - select contact__view_create( - null, - :src, - :privilege_required, - :privilege_object_id, - :contact_object_type, - :package_id, - :sort_order, - now(), - :creation_user, - :creation_ip, - :context_id) as view_id - - - - - - - select contact__view_name_save( - :view_id, - :locale, - :name - ) - - - - - - - select '1' from contact_views limit 1 - - - - - - - select package_id from apm_packages where package_key = 'contacts' - - - - - - - select 1 from contact_views where view_id = :view_id and contact_object_type = :object_type - - - - - - - select * - from contact_views - where view_id = :view_id - - - - - - - select name from contact_view_names where view_id = :view_id and locale = :locale - - - - - - select view_id from contact_views where contact_object_type = :object_type order by sort_order limit 1 - - - - + + + + + + select sort_order + from contact_views + where contact_object_type = :contact_object_type + order by sort_order desc limit 1 + + + + + + + select contact__view_create( + null, + :src, + :privilege_required, + :privilege_object_id, + :contact_object_type, + :package_id, + :sort_order, + now(), + :creation_user, + :creation_ip, + :context_id) as view_id + + + + + + + select contact__view_name_save( + :view_id, + :locale, + :name + ) + + + + + + + select '1' from contact_views limit 1 + + + + + + + select package_id from apm_packages where package_key = 'contacts' + + + + + + + select 1 from contact_views where view_id = :view_id and contact_object_type = :object_type + + + + + + + select * + from contact_views + where view_id = :view_id + + + + + + + select name from contact_view_names where view_id = :view_id and locale = :locale + + + + + + select view_id from contact_views where contact_object_type = :object_type order by sort_order limit 1 + + + + Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/add-edit-complaint.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/add-edit-complaint.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/bulk-update.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/bulk-update.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/bulk-update.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/changes.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/changes.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/comment-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/comments.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/comments.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/complaint-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/complaint-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/complaint.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/complaint.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.37.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-ae-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-archive-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-archive.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-archive.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-complaint.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-current-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-current.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-current.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-edit.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.14.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-groups.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-groups.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-rels-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-rels.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.19.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact-rels.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.38.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.31.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/contact.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/files-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/files-update.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/files.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/files.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-delete-confirm.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-parties-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-parties-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-parties-remove.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-parties-remove.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-party-add-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-party-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-party-add.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/group-party.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/history.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/history.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/index.adp,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/index.adp 13 Jan 2005 13:57:07 -0000 1.2 +++ openacs-4/packages/contacts/www/index.adp 30 Nov 2005 15:31:02 -0000 1.2.2.1 @@ -1,87 +1,19 @@ - + -@title@ -@context@ - - - - - - -
-[ Admin ] -
+

+ + - - - - - - - - - - - - -
- - - -

- - - - - - - -
- #contacts.Search# (clear) - -
-
- - @export_vars_search_form;noquote@ - -
-
-

- - - -

- - - - - - - -
- #contacts.Limit_Contacts_to# (clear) -
- @category_select;noquote@ -
-

-
- - - -
-
-

@letter_bar;noquote@

- - -

#contacts.Showing# @first_row@ - @last_row@ #contacts.of# @total_rows@ -| Prev -| Next -

-
-
- - -
- - - + + + \ No newline at end of file Index: openacs-4/packages/contacts/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/index.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/index.tcl 13 Jan 2005 13:57:08 -0000 1.2 +++ openacs-4/packages/contacts/www/index.tcl 30 Nov 2005 15:31:02 -0000 1.2.2.1 @@ -1,357 +1,93 @@ ad_page_contract { + List and manage contacts. - @author Matthew Geddert openacs@geddert.com @creation-date 2004-07-28 @cvs-id $Id$ - } { - {searchterm ""} - {letter ""} - {num_rows "20"} - {start_row:naturalnum "0"} - {category_id:multiple,optional} - {groupby:optional} - {orderby:optional} - {sortby "first_names"} + {orderby "first_names,asc"} {format "normal"} - {status "current"} - {object_type ""} + {search_id:integer ""} + {query ""} + {page:optional} + {page_size:integer ""} + {add_person:optional} + {add_organization:optional} + {aggregate_attribute_id ""} + {aggregate_extend_id:multiple ""} + {extend_values:optional ""} + {attr_val_name:optional ""} } -set admin_p [ad_permission_p [ad_conn package_id] admin] - -set title "Contacts" -set context {} - -set valid_numrows [list 10 20 50 100 ALL] -if { [lsearch $valid_numrows $num_rows] < 0 } { - set num_rows 50 +if { [exists_and_not_null add_person] } { + ad_returnredirect "add/person" + ad_script_abort +} elseif { [exists_and_not_null add_organization] } { + ad_returnredirect "add/organization" + ad_script_abort } +set aggregated_p 0 +if {[exists_and_not_null aggregate_attribute_id] } { + set aggregated_p 1 +} - -if { $num_rows == "ALL" } { - set start_row 0 +set extend_p 0 +if { [exists_and_not_null search_id] } { + set extend_p 1 } +set user_id [ad_conn user_id] +set package_id [ad_conn package_id] - - - -set export_vars_page_nav [export_vars -url { category_id format letter num_rows object_type orderby searchterm sortby status }] -set export_vars_search_form [export_vars -form { category_id format num_rows object_type orderby sortby status }] -set export_vars_search_url [export_vars -url { category_id format num_rows object_type orderby sortby status }] -set export_vars_letter_url [export_vars -url { category_id format num_rows object_type orderby sortby status }] -set export_vars_sortby_url [export_vars -url { category_id format letter num_rows object_type orderby searchterm status }] -set export_vars_num_rows_url [export_vars -url { category_id format letter object_type orderby searchterm sortby status }] -set export_vars_category_form [export_vars -form { format letter num_rows object_type orderby searchterm sortby status }] -set export_vars_category_url [export_vars -url { format letter num_rows object_type orderby searchterm sortby status }] - - - - -if {[exists_and_not_null category_id]} { - set category_id_filter "party_id in ( select object_id from category_object_map where category_id = $category_id )" - set temp_category_id $category_id -} else { - set category_id_filter "" - set temp_category_id "" +set valid_page_sizes [list 25 50 100 500] +if { ![exists_and_not_null page_size] || [lsearch $valid_page_sizes $page_size] < 0 } { + set page_size [parameter::get -boolean -parameter "DefaultPageSize" -default "50"] } -set categories_p [contacts::categories::enabled_p] +set contacts_total_count [contact::search::results_count -search_id $search_id -query $query] -if { [string is true $categories_p] } { -set category_select [contacts::categories::get_selects -export_vars $export_vars_category_form -category_id $temp_category_id] +if { $aggregated_p } { + set contacts_total_count "$contacts_total_count" } - -set searchterm_filter "upper(sort_$sortby) like upper('%$searchterm%')" -set letter_filter "upper(sort_$sortby) like upper('$letter%')" - -if { [lsearch [list organization person] $object_type] < 0 } { - set object_type_filter "" -} else { - set object_type_filter "object_type = '$object_type'" +if { [exists_and_not_null search_id] } { + contact::search::log -search_id $search_id } -if { [lsearch [list current archived] $status] < 0 } { - set status_filter "" -} else { - set status_filter "status = '$status'" +set public_searches [lang::util::localize_list_of_lists -list [db_list_of_lists public_searches {}]] +set search_options [concat [list [list [_ contacts.All_Contacts] ""]] $public_searches] +set searchcount 1 +db_foreach my_recent_searches {} { + lappend search_options [list "${searchcount}) ${recent_title}" ${recent_search_id}] + incr searchcount } +lang::util::localize_list_of_lists -list $search_options -if { $status == "archived" } { -set bulk_actions [list \ - "\#contacts.Make_Current\#" "contact-current" "\#contacts.Make_the_checked_contacts_current\#"] -} else { -set bulk_actions [list \ - "\#contacts.Archive\#" "contact-archive" "\#contacts.Archive_the_checked_contacts\#"] -} -# "\#contacts.Add_to_Category\#" "contacts-category-add" "\#contacts.Add_the_selected_contacts_to_a_category\#" -# "\#contacts.Send_Email\#" "bulk-email" "\#contacts.Send_an_email_message_to_the_selected_contacts\#" \ -list::create \ - -html { width 100% } \ - -name entries \ - -multirow entries \ - -key party_id \ - -row_pretty_plural "Contacts" \ - -checkbox_name checkbox \ - -selected_format $format \ - -class "list" \ - -main_class "list" \ - -sub_class "narrow" \ - -pass_properties { - variable - } -actions { - "\#contacts.Add_a_Person\#" "contact-ae?object_type=person" "\#contacts.Add_a_Person\#" - "\#contacts.Add_an_Organization\#" "contact-ae?object_type=organization" "\#contacts.Add_an_Organization\#" - } -bulk_actions $bulk_actions \ - -elements { - edit { - label {} - display_template { - Edit - } +set form_elements { + {search_id:integer(select),optional {label ""} {options $search_options} {html {onChange "javascript:acs_FormRefresh('search')"}}} + {query:text(text),optional {label ""} {html {size 20 maxlength 255}}} + {save:text(submit) {label {[_ contacts.Search]}} {value "go"}} + {results_count:integer(inform),optional {label "  [_ contacts.Results] $contacts_total_count "}} +} - } - contact_name { - display_col contact_name - link_url_eval $contact_url - label "\#contacts.Contact\#" - } - first_names { - display_col first_names - label "First Names" - } - last_name { - display_col last_name - label "Last Name" - } - organization_name { - display_col name - label "Organization" - } - email { - display_template { - @entries.email_url;noquote@ - } - label "\#contacts.Email_Address\#" - } - contact_type { - display_template { - \#contacts.Organization\# - \#contacts.Person\# - } - label "\#contacts.Contact_Type\#" - } - } -filters { - sortby { - label "\#contacts.Sort_By\#" - values { - {{\#contacts.First_Names\#} first_names} - {{\#contacts.Last_Name\#} last_name} - } - where_clause {} - } - start_row {} - category_id { - label Categories - where_clause {$category_id_filter} - } - letter { - label "Letter" - where_clause {$letter_filter} - } - object_type { - label "\#contacts.Contact_Type\#" - values { - {{\#contacts.Organization\#} organization} - {{\#contacts.Person\#} person} - } - where_clause {$object_type_filter} - } - searchterm { - label "Search" - where_clause {$searchterm_filter} - } - status { - label "\#contacts.Status\#" - values { - {{\#contacts.Current\#} current} - {{\#contacts.Archived\#} archived} - } - where_clause {$status_filter} - } - num_rows { - label "\#contacts.Number_of_Rows\#" - values { - {10 10} - {20 20} - {50 50} - {100 100} - {500 500} - {All ALL} - } - } - } -groupby { - } -orderby { - default_value contact_name,asc - contact_name { - label "\#contacts.Contact\#" - orderby_desc "contacts.sort_$sortby desc, contacts.object_type desc, contacts.email desc" - orderby_asc "contacts.sort_$sortby asc, contacts.object_type desc, contacts.email desc" - default_direction asc - } - email { - label "\#contacts.Email_Address\#" - orderby_desc "contacts.email desc, contacts.sort_$sortby desc, contacts.object_type desc" - orderby_asc "contacts.email asc, contacts.sort_$sortby desc, contacts.object_type desc" - default_direction asc - } - contact_type { - label "\#contacts.Contact_Type\#" - orderby_desc "contacts.object_type desc, contacts.sort_$sortby desc, contacts.email desc" - orderby_asc "contacts.object_type asc, contacts.sort_$sortby desc, contacts.email desc" - default_direction asc - } - } -formats { - normal { - label "Table" - layout table - row { - checkbox {} - edit {} - contact_name {} - email {} - contact_type {} - } - } - csv { - label "CSV" - output csv - row { - contact_name {} - first_names {} - last_name {} - organization_name {} - email {} - contact_type {} - } - } +if { [parameter::get -boolean -parameter "ForceSearchBeforeAdd" -default "0"] } { + if { [exists_and_not_null query] && $search_id == "" } { + append form_elements { + {add_person:text(submit) {label {[_ contacts.Add_Person]}} {value "1"}} + {add_organization:text(submit) {label {[_ contacts.Add_Organization]}} {value "1"}} + } } - -# This query will override the ad_page_contract value entry_id - -# left join category_object_map c on (contact_attrs.party_id = c.object_id) -set multirow_query " -" -# [template::list::sortby_clause -sortby -name entries] - -db_multirow -extend { contact_url email_url object_type_pretty } -unclobber entries get_contact_info {} { - set contact_url "view/$party_id" - if { [exists_and_not_null email] } { - set email_url "$email" - } - if { $object_type == "organization" } { - set object_type_pretty "\#contacts.Organization\#" - } else { - set object_type_pretty "\#contacts.Person\#" - } } - -set initial_list_query " -select distinct upper(substr(sort_$sortby,1,1)) - from contacts - where party_id is not null -" - -if { [exists_and_not_null category_id_filter ] } { - append initial_list_query "and $category_id_filter\n" -} -# we cannot use the letter filter because it defeats the purpose -#if { [exists_and_not_null letter_filter ] } { -# append initial_list_query "and $category_id_filter" -# -#} -if { [exists_and_not_null object_type_filter ] } { - append initial_list_query "and $object_type_filter\n" -} -if { [exists_and_not_null searchterm_filter ] } { - append initial_list_query "and $searchterm_filter\n" -} -if { [exists_and_not_null status_filter ] } { - append initial_list_query "and $status_filter\n" -} - -set initial_list [db_list_of_lists get_list_of_starting_letters $initial_list_query] - - - -set letter_bar [contacts::util::letter_bar -letter $letter -export_vars $export_vars_letter_url -initial_list $initial_list] - - -# pagination - hopefully once list builder has pagination documenation -# this can be built into list builder - - -db_1row get_total_rows " -select count(*) as total_rows - from contacts - where party_id is not null - [template::list::filter_where_clauses -and -name entries] -" - -if { $num_rows != "ALL" } { - - set first_row [expr $start_row + 1] - set last_row [expr $start_row + $num_rows] - - if { $num_rows >= $total_rows } { - set first_row 1 - set last_row $total_rows - set start_row 0 +ad_form -name "search" -method "GET" -export {orderby page_size format} -form $form_elements \ + -on_request { + } -edit_request { + } -on_refresh { + } -on_submit { + } -after_submit { } - - if { $last_row >= $total_rows } { - set next_link_p 0 - set last_row $total_rows - } else { - set next_link_p 1 - set next_link_url "?start_row=$last_row&$export_vars_page_nav" - } - if { $start_row == "0" } { - set prev_link_p 0 - } else { - set prev_link_p 1 - set prev_link_start_row [expr $start_row - $num_rows] - if { $prev_link_start_row < "0" } { - set prev_link_start_row "0" - } - set prev_link_url "?start_row=$prev_link_start_row&$export_vars_page_nav" - } - -} else { - set next_link_p 0 - set prev_link_p 0 - set first_row 1 - set last_row $total_rows -} -template::list::write_output -name entries - - - - - - - - - -ad_return_template - - Fisheye: Tag 1.10.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/index.vuh'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/index.xql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/index.xql 13 Jan 2005 13:57:09 -0000 1.2 +++ openacs-4/packages/contacts/www/index.xql 30 Nov 2005 15:31:02 -0000 1.2.2.1 @@ -1,18 +1,31 @@ - - -select contacts.*, sort_$sortby as contact_name - from contacts - where party_id is not null - [template::list::filter_where_clauses -and -name entries] - [template::list::orderby_clause -orderby -name entries] - limit $num_rows offset $start_row - - + + + select title, + search_id + from contact_searches + where owner_id = :package_id + and title is not null + and not deleted_p + order by lower(title) + + + + + select cs.title as recent_title, + cs.search_id as recent_search_id + from contact_searches cs, contact_search_log csl + where csl.user_id = :user_id + and cs.search_id = csl.search_id + and cs.title is not null + and cs.owner_id != :package_id + and not cs.deleted_p + order by last_search desc + limit 10 + + - - Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/mail-tracking.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/mail-tracking.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message-action.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message-action.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message-log.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message-log.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message-messages.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.20.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.21.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/message.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/messages.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/messages.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/messages.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/person-groups-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/person-groups-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/person-upgrade-to-user.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/relationship-add-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/relationship-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/relationship-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/relationship-ae-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/relationship-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/relationship-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/relationship-delete-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/relationship-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/search-action.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/search-action.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/search-condition-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/search-help.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/search-help.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.9.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/search.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.23.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/search.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/search.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/searches.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/searches.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/searches.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/select-groups.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/select-groups.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/settings.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/settings.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/signature.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/signature.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-add-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-ae-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-depreciate-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-depreciate.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-list.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-list.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-list.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-restore-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attribute-restore.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attributes-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attributes.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/attributes.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/ext-search-options.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/ext-search-options.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/ext-search-options.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/group-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/group-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/group-map.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/group-map.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/index.adp,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/admin/index.adp 13 Jan 2005 13:57:12 -0000 1.2 +++ openacs-4/packages/contacts/www/admin/index.adp 30 Nov 2005 15:31:03 -0000 1.2.2.1 @@ -1,15 +1,26 @@ - - + @title@ @context@ +

+#contacts.Relationships# +#contacts.Add_Group# +#contacts.lt_Instance_Permissions_# +#acs-subsite.Parameters# +#contacts.Extended_search_opt# +

+

#contacts.READ_THESE#

+
    +
  • #contacts.lt_Make_sure_you_do_not_#
  • +
  • #contacts.lt_The_default_group_mus#
  • +
+

#contacts.lt_Once_ready_for_releas#

+ - Index: openacs-4/packages/contacts/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/index.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/admin/index.tcl 13 Jan 2005 13:57:13 -0000 1.2 +++ openacs-4/packages/contacts/www/admin/index.tcl 30 Nov 2005 15:31:03 -0000 1.2.2.1 @@ -6,19 +6,132 @@ } { - {orderby "name"} } -set title "Contact Administration" + +set orderby "name" +set title "[_ contacts.lt_Contact_Administratio]" set context {} set package_id [ad_conn package_id] +set parameter_url [export_vars -base "/shared/parameters" {package_id {return_url "[ad_conn url]"}}] +template::list::create \ + -name "groups" \ + -multirow "groups" \ + -row_pretty_plural "[_ contacts.groups]" \ + -elements { + edit { + label {} + display_template { + [_ acs-kernel.common_Edit] + } + } + group_name { + label {Group} + display_col group_name + } + member_count { + label {[_ contacts.Contacts]} + display_col member_count + link_url_eval $group_url + } + mapped { + label {Mapped} + display_template { + + [_ contacts.True] + + + [_ contacts.False] + + } + } + default { + label {Default} + display_template { + + [_ contacts.True] + + + + [_ contacts.False] + + + + + } + } + person_form { + display_template { + [_ contacts.Person_Form] + } + } + org_form { + display_template { + [_ contacts.Organization_Form] + } + } + categories { + display_template { + [_ contacts.Manage_group_categories] + } + } + actions { + display_template { + [_ contacts.Permissions] + } + } + } -filters { + } -orderby { + } +multirow create groups group_id group_name group_url ams_person_url ams_org_url member_count level mapped_p default_p categories_url +set return_url [ad_conn url] +foreach group [contact::groups -indent_with "..." -expand "all" -output "all" -privilege_required "admin" -all] { + set group_id [lindex $group 1] + set group_name [lindex $group 0] + set member_count [lindex $group 2] + set level [lindex $group 3] + set mapped_p [lindex $group 4] + set default_p [lindex $group 5] + set ams_person_url [ams::list::url \ + -package_key "contacts" \ + -object_type "person" \ + -list_name "${package_id}__${group_id}" \ + -pretty_name "${package_id}__${group_id}" \ + -return_url $return_url \ + -return_url_label "[_ contacts.Return_to_title]"] + set ams_org_url [ams::list::url \ + -package_key "contacts" \ + -object_type "organization" \ + -list_name "${package_id}__${group_id}" \ + -pretty_name "${package_id}__${group_id}" \ + -return_url $return_url \ + -return_url_label "[_ contacts.Return_to_title]"] + set categories_url [export_vars -base "/categories/cadmin/object-map" -url {{object_id $group_id}}] + multirow append groups [lindex $group 1] [lindex $group 0] "../?group_id=${group_id}" $ams_person_url $ams_org_url $member_count $level $mapped_p $default_p $categories_url -set organization_object_id [contacts::util::organization_object_id] -set person_object_id [contacts::util::person_object_id] +} +set default_group [contacts::default_group] + set ams_person_url [ams::list::url \ + -package_key "contacts" \ + -object_type "person" \ + -list_name "${package_id}__${default_group}" \ + -pretty_name "${package_id}__${default_group}" \ + -return_url $return_url \ + -return_url_label "[_ contacts.Return_to_title]"] + set ams_org_url [ams::list::url \ + -package_key "contacts" \ + -object_type "organization" \ + -list_name "${package_id}__${default_group}" \ + -pretty_name "${package_id}__${default_group}" \ + -return_url $return_url \ + -return_url_label "[_ contacts.Return_to_title]"] + + + ad_return_template Index: openacs-4/packages/contacts/www/admin/permissions-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/permissions-postgresql.xql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/admin/permissions-postgresql.xql 13 Jan 2005 13:57:13 -0000 1.2 +++ openacs-4/packages/contacts/www/admin/permissions-postgresql.xql 30 Nov 2005 15:31:03 -0000 1.2.2.1 @@ -1,14 +1,14 @@ - - - - postgresql7.1 - - - - - - select acs_object__name(:object_id) as object_name - - - - + + + + postgresql7.1 + + + + + + select acs_object__name(:object_id) as object_name + + + + Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/permissions-user-add.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/permissions-user-add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/www/admin/permissions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/permissions.adp,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/admin/permissions.adp 13 Jan 2005 13:57:14 -0000 1.2 +++ openacs-4/packages/contacts/www/admin/permissions.adp 30 Nov 2005 15:31:03 -0000 1.2.2.1 @@ -1,7 +1,5 @@ - @title@ + @page_title@ @context@ -

Note: Write permission is needed to create or edit a contact and/or any sepecific attribute associated with that contact type. By default all attributes inherit permissions from the package.

- - + Index: openacs-4/packages/contacts/www/admin/permissions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/permissions.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/admin/permissions.tcl 13 Jan 2005 13:57:14 -0000 1.2 +++ openacs-4/packages/contacts/www/admin/permissions.tcl 30 Nov 2005 15:31:03 -0000 1.2.2.1 @@ -1,14 +1,16 @@ ad_page_contract { - Permissions for contacts and contact-attributes - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 + Permissions for the subsite itself. + + @author Lars Pind (lars@collaboraid.biz) + @creation-date 2003-06-13 @cvs-id $Id$ - } { - object_id:integer + group_id:integer } -set object_name [db_string get_object_name {}] -set title "Permissions for $object_name" -set context [list $title] +set object_id $group_id + +set page_title "[_ contacts.Permissions]" + +set context [list $page_title] + Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/relationship-ae-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/relationship-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/relationship-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/relationship-ae.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/relationships-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/relationships.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/relationships.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/remove-default.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/role-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/role-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/roles.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/roles.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/search-list.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/search-list.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/search-list.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/admin/set-default.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/www/admin/widgets-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/widgets-postgresql.xql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/admin/widgets-postgresql.xql 13 Jan 2005 13:57:14 -0000 1.2 +++ openacs-4/packages/contacts/www/admin/widgets-postgresql.xql 30 Nov 2005 15:31:03 -0000 1.2.2.1 @@ -1,15 +1,15 @@ - - - - postgresql7.1 - - - - - - select * from contact_widgets order by storage_column, description - - - - - + + + + postgresql7.1 + + + + + + select * from contact_widgets order by storage_column, description + + + + + Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-answer-optional-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-answer-optional.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-answer-required-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-answer-required.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-map-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-map.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-order-update-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-order-update.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-unmap-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/attributes-unmap.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/object-map-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/object-map.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/cadmin/object-map.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/contacts/www/resources/contacts-print.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/resources/contacts-print.css,v diff -u -r1.4.2.1 -r1.4.2.2 Binary files differ Index: openacs-4/packages/contacts/www/resources/contacts.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/resources/contacts.css,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/contacts/www/resources/contacts.css 13 Jan 2005 13:57:16 -0000 1.2 +++ openacs-4/packages/contacts/www/resources/contacts.css 30 Nov 2005 15:31:04 -0000 1.2.2.1 @@ -1,3 +1,180 @@ +/* Comments Style Sheet + + @author Matthew Geddert openacs@geddert.com + @creation-date 2005-05-15 + @cvs-id $Id$ + +----------------------------------------------- */ + +/* For Portlets */ + +td.highlighted { + background-color:#ddddff; +} + +td.highlight { + background-color:#ffffdd; + border-bottom: 1px dotted #A0BDEB; +} + +td.subheader { + background-color:#ffffdd; + border-top: 1px dotted #e6e6fa; + border-bottom: 1px dotted #e6e6fa; + border-left: 1px solid #e6e6fa; +} + +td.list-bg { + border-left: 1px solid #e6e6fa; +} + +td.list-bottom-bg { + border-bottom: 1px solid #e6e6fa; + border-left: 1px solid #e6e6fa; +} + +td.list-right-bg { + border-bottom: 1px solid #e6e6fa; + border-right: 1px solid #e6e6fa; +} + +th.project { + background-color:#9999cc; +} + +td.project-filter-pane { + background-color: #bbbbee; + vertical-align: top; +} + +.shaded { + background-color: #dddddd; +} + +.selected { + background-color: #eeccdd; +} + +th { + font-size: 9pt; + text-align: left; + background-color:dfdfff; +} + + +/* From logger */ + +table.logger_navbar { + background-color: #41329c; + clear: both; +} +a.logger_navbar { + color: white; + text-decoration: none; +} +a.logger_navbar:visited { + color: white; +} +a.logger_navbar:hover { + color: white; + text-decoration: underline; +} +td.logger_navbar { + font-family: tahoma,verdana,arial,helvetica; + font-size: 70%; + font-weight: bold; + color: #ccccff; + text-decoration: none; +} + +td.fill-list-right { + border-bottom: 3px solid #A0BDEB; + border-right: 1px solid #A0BDEB; + background-color: #eaf2ff; +} + +td.fill-list-right2 { + border-right: 1px solid #A0BDEB; + background-color: #eaf2ff; +} + +td.fill-list-bottom { + border-bottom: 3px solid #A0BDEB; + border-left: 1px solid #A0BDEB; + background-color: #eaf2ff; +} + +td.fill-list-middle { + border-left: 1px solid #A0BDEB; + background-color: #eaf2ff; +} + +td.fill-list-bg { + background-color: #eaf2ff; +} + +#search-block { + border:1px solid #000; + background-color: #EAF2FF; + padding:5px; + width:70%; +} + +/* End of Portlets*/ + +div#contact-info { + clear: both; +} +#contact-info h3 { + clear: both; +} +#contact-info div.primary { + width: 48%; + float: left; +} +#contact-info div.secondary { + width: 48%; + float: right; +} +p.last-updated { + clear: both; + font-size: small; + text-align: right; +} +dl.comments { + font-size: 100%; + margin: 0px; + padding: 0px; + } +dl.comments dt { + margin: 5px 0px 0px 0px; + background: #EEE; + font-weight: normal; + font-size: 100%; + } +dl.comments dd { + padding: 5px; + margin: 0 0px 0px 0px; + background: #EEE; + } +dl.comments dt.odd, dl.comments dd.odd { + background: #DDD; + } +dl.comments dt.mine-odd, dl.comments dd.mine-odd { + background: #FFFFFF; + } +dl.comments dt.mine-even, dl.comments dd.mine-even { + background: #FFFFFF; + } +dl.comments .number { + padding: 0px 5px 0px 0px; + margin: 0px 2px 0px 0px; + border-style: solid; + border-width: 0px 1px 0px 0px; + border-color: #CCC; + font: 160% Georgia,Serif; + } + #contacts-sortbars { font:70% verdana,sans-serif; } @@ -8,3 +185,181 @@ #contacts-sortbars a:hover { text-decoration: underline; } + +div.letter { + margin-bottom: 10px; + padding-bottom: 10px; + border-bottom: 1px solid #AAA; +} +.address-widget { + width: 300px; +} +.address-widget-country-code { + width: 100%; +} + + +.hidden { + display: none; +} + +span.overdue { + color: red; +} + +#section { + margin: 0px 0px 0px 0px; +} + +#section ul { + border-left: 1px solid #333; + margin: 0px 0px 10px 0px; + padding: 0px; + text-transform: lowercase; + background: #CCC; +} + +#section ul li { + display:inline; + margin:0; + padding:0; + background-image:none; +} + +#section ul a { + float:left; + display:block; + padding: 0px 5px 2px 5px; + border-width:0; + border-style:none; + border-top: 4px solid #CCC; + border-right: 1px solid #000; + border-bottom: 1px solid #CCC; + text-decoration:none; + color:#000; +} +#section ul a:hover { + border-top: 4px solid #000; +} +#section ul strong { + border-top: 4px solid #000; + margin: 0px -5px 0px -5px; + padding: 0px 5px 2px 5px; + background-color: #FFF; + border-bottom: 1px solid #FFF; +} + +#section ul a:hover { + color: red; +} + + + +#section ul em { + float:none; + display:block; + padding: 4px 5px 2px 5px; + border-right-width:0; + border-bottom: 1px solid #CCC; + } + +h3.contact-title { + margin: 0; + padding: 0; + clear: both; + line-height: 2em; +} + +dt.attribute-name { + margin: 0; + padding: 0; + font: 90% Verdana,Georgia,Serif; + text-align: right; + line-height: 1.5em; + border-width: 0; + width: 33%; + float: left; + clear: both; +} + +dd.attribute-value { + margin: 0; + padding: 0 0 .5em 0; + text-align: left; + line-height: 1.2em; + border-width: 0; + width: 65%; + float: right; + font: 90% Verdana,Georgia,Serif; +} +dl.attribute-values { + margin: 0; + padding: 0; +} + + + + +/* Tasks */ +div.tasks * { + margin: 0; + padding: 0; +} +div.tasks h3 { + padding-bottom: 5px; +} +div.tasks ul { + padding-left: 1em; + list-style: square; +} +div.tasks li { + padding-bottom: .5em; +} +div.tasks dt { + clear: both; + float: left; + width: 25%; +} +div.tasks dd { + float: right; + width: 73%; + padding-bottom: .75em; +} + +#tasks dt { + display: block; + float: left; + margin: 0px; + width: 120px; + padding-top: 2px; +} +#tasks dl { + margin: 5px 0px 0px 0px; +} +#tasks ul { + margin: 0px 0px 0px -10px; + clear: both; +} +#tasks li { + margin: 0px; +} +.done { + color: #BBB; +} +.contact-editlink { + padding-left: 1em; + font: 100% Verdana,Georgia,Serif; +} +.contact-attributes { + clear:both; + display: block; + margin-left: 10px; + font: 90% Verdana,Georgia,Serif; +} +.contact-attributes a { + text-decoration: none; + color: #000; +} +.contact-attributes a:hover { + text-decoration: underline; +} Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/comments-view-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/comments-view.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/comments-view.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/contact-view.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/contact-view.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/index.vuh'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/view-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/view.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/contacts/www/view/view.tcl'. Fisheye: No comparison available. Pass `N' to diff?