+Move glossar
+@context@
+
+Move glossar
+
+Search for Customers who's name contains:
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/glossar/www/glossar-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/glossar/www/glossar-move.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/glossar/www/glossar-move.tcl 13 Nov 2005 13:39:56 -0000 1.1
@@ -0,0 +1,39 @@
+ad_page_contract {
+ glossar-move
+
+ A page to allow the moving of a glossar to other customers.
+
+ @author Al-Faisal El-Dajani (faisal.dajani@gmail.com)
+ @creation-date 2005-10-24
+
+} {
+ {return_url "/"}
+ {query ""}
+ {glossar_id:notnull,multiple}
+}
+
+set context "search"
+set search_id ""
+set glossar_id [string trim $glossar_id "{}"]
+
+
+ad_form -name search -export {glossar_id} -form {
+ {query:text(text) {label ""} {html {size 24}}}
+ {Search:text(submit) {value "Search"}}
+}
+
+template::list::create \
+ -name customers \
+ -multirow customers \
+ -key customer_id \
+ -elements {
+ name {
+ label {}
+ display_template {
+ @customers.name@ \[select\]
+ }
+ }
+ }
+db_multirow -extend {move_url} customers get_customers_from_prefix {} {
+ set move_url [export_vars -base "move-glossar" {{customer_id $organization_id} glossar_id:multiple return_url}]
+}
\ No newline at end of file
Index: openacs-4/packages/glossar/www/glossar-move.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/glossar/www/glossar-move.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/glossar/www/glossar-move.xql 13 Nov 2005 13:39:56 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ SELECT o.name , o.organization_id
+ FROM organizations o, parties p
+ WHERE o.organization_id = p.party_id
+ AND o.organization_id in ([template::util::tcl_to_sql_list [group::get_members -group_id [group::get_id -group_name "Customers"]]])
+ [contact::search_clause -and -search_id $search_id -query $query -party_id "o.party_id" -revision_id "revision_id"]
+
+
+
+
+
+
Index: openacs-4/packages/glossar/www/move-glossar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/glossar/www/move-glossar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/glossar/www/move-glossar.tcl 13 Nov 2005 13:39:56 -0000 1.1
@@ -0,0 +1,27 @@
+ad_page_contract {
+ Moves a glossar to a customer
+} {
+ customer_id:integer,notnull
+ glossar_id:integer,notnull,multiple
+ {return_url}
+}
+
+foreach id $glossar_id {
+ set glossar_revision_id [content::item::get_best_revision -item_id $id]
+ db_1row get_glossar_info {
+ SELECT g.source_category_id, g.target_category_id, g.etat_id, r.title, r.description
+ FROM gl_glossars g, cr_revisions r
+ WHERE g.glossar_id = :glossar_revision_id
+ AND g.glossar_id = r.revision_id
+ }
+
+ gl_glossar::edit -glossar_item_id $id \
+ -owner_id $customer_id \
+ -source_category_id $source_category_id\
+ -target_category_id $target_category_id\
+ -etat_id $etat_id \
+ -title $title \
+ -description $description
+}
+
+ad_returnredirect $return_url
\ No newline at end of file