Author: benj
Date: Tue May 10 11:42:20 2016
New Revision: 1669
URL: http://svn.gna.org/viewcvs/gdtc?rev=1669&view=rev
Log:
Add new page to change mail level for actors (#24593)
Modified:
trunk/gdtc/include/my.php
Modified: trunk/gdtc/include/my.php
URL:
http://svn.gna.org/viewcvs/gdtc/trunk/gdtc/include/my.php?rev=1669&r1=1668&r2=1669&view=diff
==============================================================================
--- trunk/gdtc/include/my.php (original)
+++ trunk/gdtc/include/my.php Tue May 10 11:42:20 2016
@@ -105,6 +105,32 @@
$smarty -> assign ( 'additional', $additional );
$smarty -> display ( 'my/mail_subscriptions.tpl' );
+}
+
+
+
+/**
+ * Allow to change mail subscriptions level
+ *
+ */
+function mail_level ( $args, $do_submit )
+{
+ $smarty = init_smarty ();
+
+ $additional = get_all_actor_details ( my_id () );
+ $smarty -> assign ( 'mail_level', $additional [ 'details' ] [
'mailing_level' ] );
+
+ if ( $do_submit && preg_match ( '/^\d+$/', $args [ 'mailing-level' ] ) )
+ {
+ $commit [ 'mailing_level' ] = $args [ 'mailing-level' ];
+ $result = commit ( $additional [ 'actor_type' ], 'actor_id',
+ $additional [ 'actor_infos' ] [ 'actor_id' ],
$commit );
+ $additional = array_merge ( $additional, $result );
+ $smarty -> assign ( 'mail_level', $args [ 'mailing-level' ] );
+ }
+
+ $smarty -> assign ( 'additional', $additional );
+ $smarty -> display ( 'my/mail_level.tpl' );
}
_______________________________________________
Gdtc-commits mailing list
[email protected]
https://mail.gna.org/listinfo/gdtc-commits