This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  fb6465ee9951d80118f67835516468c2f4442c7f (commit)
       via  7f30e0b8ae3ccac4c5b3664c4df61649029305c9 (commit)
      from  b6214c29f8f30d648105570e6678f1d0eecf4543 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=fb6465ee9951d80118f67835516468c2f4442c7f

commit fb6465ee9951d80118f67835516468c2f4442c7f
Author: Franck Villaume <[email protected]>
Date:   Sun Feb 21 17:55:51 2016 +0100

    use HTML helpers, display warning message when no user found

diff --git a/src/www/admin/unsubscribe.php b/src/www/admin/unsubscribe.php
index 2287a81..ae6041a 100644
--- a/src/www/admin/unsubscribe.php
+++ b/src/www/admin/unsubscribe.php
@@ -7,7 +7,7 @@
  *
  * Copyright 1999-2001 (c) VA Linux Systems
  * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
- * Copyright 2014, Franck Villaume - TrivialDev
+ * Copyright 2014,2016 Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -45,24 +45,19 @@ if (getStringFromRequest('submit') && $user_name) {
                                Show form for unsubscription type selection
                */
 
-               site_admin_header(array('title'=>_('Site Mailings Subscription 
Maintenance')));
-               ?>
-
-               <h2><?php echo _('Unsubscribe user:'); ?> <?php echo 
$user_name; ?></h2>
-               <p>
-               <?php echo _('You can unsubscribe user either from 
admin-initiated sitewide mailings or from all site mailings (admin-initiated 
and automated mailings, like forum and file release notifications).'); ?>
-               </p>
-               <form action="<?php echo 
util_make_uri('/admin/unsubscribe.php'); ?>" method="post">
-               <input type="hidden" name="user_name" value="<?php echo 
$user_name?>" />
-               <?php echo _('Unsubscription 
type:').html_build_select_box_from_arrays(
-                       array(_('MAIL'),_('All')),
-                       array(_('Admin-initiated mailings'),_('All site 
mailings')),
-                       'type',false,false
-               ); ?>
-               <input type="submit" name="submit" value="<?php echo 
_('Unsubscribe'); ?>" />
-               </form>
-
-               <?php
+               site_admin_header(array('title' => _('Site Mailings 
Subscription Maintenance')));
+               echo html_e('h2', array(), _('Unsubscribe user')._(': 
').$user_name);
+               echo html_e('p', array(), _('You can unsubscribe user either 
from admin-initiated sitewide mailings or from all site mailings 
(admin-initiated and automated mailings, like forum and file release 
notifications).'));
+               echo $HTML->openForm(array('action' => 
'/admin/unsubscribe.php', 'method' => 'post'));
+               echo html_e('input', array('type' => 'hidden', 'name' => 
'user_name', 'value' => $user_name));
+               echo _('Unsubscription type')._(': ')
+                       .html_build_select_box_from_arrays(
+                               array(_('MAIL'),_('All')),
+                               array(_('Admin-initiated mailings'),_('All site 
mailings')),
+                               'type',false,false
+                       );
+               echo html_e('input', array('type' => 'submit', 'name' => 
'submit', 'value' => _('Unsubscribe')));
+               echo $HTML->closeForm();
                site_admin_footer();
                exit();
        } else {
@@ -73,13 +68,13 @@ if (getStringFromRequest('submit') && $user_name) {
 
                $u = user_get_object_by_name($user_name);
                if (!$u || !is_object($u)) {
-                       exit_error(_('Could Not Get User'),'home');
+                       exit_error(_('Could Not Get User'), 'home');
                } elseif ($u->isError()) {
-                       exit_error($u->getErrorMessage(),'home');
+                       exit_error($u->getErrorMessage(), 'home');
                }
 
                if (!$u->unsubscribeFromMailings($type=='ALL' ? 1 : 0)) {
-                       exit_error(_('Could not unsubscribe user: 
').$u->getErrorMessage(),'home');
+                       exit_error(_('Could not unsubscribe user')._(': 
').$u->getErrorMessage(), 'home');
                }
 
                $feedback .= _('User unsubscribed');
@@ -87,19 +82,11 @@ if (getStringFromRequest('submit') && $user_name) {
 }
 
 site_admin_header(array('title'=>_('Site Mailings Subscription Maintenance')));
-
-?>
-
-<p>
-<?php printf(_('Use field below to find users which match given pattern with 
the %s username, real name, or email address (substring match is preformed, use 
\'%%\' in the middle of pattern to specify 0 or more arbitrary characters). 
Click on the username to unsubscribe user from site mailings (new form will 
appear).'), forge_get_config ('forge_name')); ?>
-</p>
-
-<form action="<?php echo util_make_uri('/admin/unsubscribe.php') ?>" 
method="post">
-<?echo _('Pattern:'); ?><input type="text" name="pattern" value="<?php echo 
$pattern; ?>" />
-<input type="submit" name="submit" value="<?php echo _('Show users matching 
pattern'); ?>" />
-</form>
-
-<?php
+echo html_e('p', array(), sprintf(_('Use field below to find users which match 
given pattern with the %s username, real name, or email address (substring 
match is preformed, use \'%%\' in the middle of pattern to specify 0 or more 
arbitrary characters). Click on the username to unsubscribe user from site 
mailings (new form will appear).'), forge_get_config('forge_name')));
+echo $HTML->openForm(array('action' => '/admin/unsubscribe.php', 'method' => 
'post'));
+echo _('Pattern')._(': ').html_e('input', array('type' => 'text', 'name' => 
'pattern', 'value' => $pattern))
+       .html_e('input', array('type' => 'submit', 'name' => 'submit', 'value' 
=> _('Show users matching pattern')));
+echo $HTML->closeForm();
 
 if ($pattern) {
        $res = db_query_params('SELECT *
@@ -109,29 +96,33 @@ if ($pattern) {
                                OR lower(email) LIKE $1',
                                array(strtolower("%$pattern%")));
 
-       $title=array();
-       $title[]='&nbsp;';
-       $title[]=_('User Id');
-       $title[]=_('User Name');
-       $title[]=_('Real Name');
-       $title[]=_('Email');
-       $title[]=_('Site Mail.');
-       $title[]=_('Comm. Mail.');
-
-       echo $HTML->listTableTop($title);
-       $i = 0 ;
-       while ($row = db_fetch_array($res)) {
-               $cells = array();
-               $cells[][] = '&nbsp;';
-               $cells[][] = $row['user_id'];
-               $cells[][] = 
util_make_link('/admin/unsubscribe.php?submit=1&user_name='.$row['user_name'], 
$row['user_name']);
-               $cells[][] = $row['realname'];
-               $cells[][] = $row['email'];
-               $cells[][] = $row['mail_siteupdates'];
-               $cells[][] = $row['mail_va'];
-               echo $HTML->multiTableRow(array('class' => 
$HTML->boxGetAltRowStyle($i++, true)), $cells);
+       if (db_numrows($res)) {
+               $title=array();
+               $title[]='&nbsp;';
+               $title[]=_('User Id');
+               $title[]=_('User Name');
+               $title[]=_('Real Name');
+               $title[]=_('Email');
+               $title[]=_('Site Mail.');
+               $title[]=_('Comm. Mail.');
+
+               echo $HTML->listTableTop($title);
+               $i = 0;
+               while ($row = db_fetch_array($res)) {
+                       $cells = array();
+                       $cells[][] = '&nbsp;';
+                       $cells[][] = $row['user_id'];
+                       $cells[][] = 
util_make_link('/admin/unsubscribe.php?submit=1&user_name='.$row['user_name'], 
$row['user_name']);
+                       $cells[][] = $row['realname'];
+                       $cells[][] = $row['email'];
+                       $cells[][] = $row['mail_siteupdates'];
+                       $cells[][] = $row['mail_va'];
+                       echo $HTML->multiTableRow(array('class' => 
$HTML->boxGetAltRowStyle($i++, true)), $cells);
+               }
+               echo $HTML->listTableBottom();
+       } else {
+               echo $HTML->warning_msg(_('No user found'));
        }
-       echo $HTML->listTableBottom();
 }
 
 site_admin_footer();

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7f30e0b8ae3ccac4c5b3664c4df61649029305c9

commit 7f30e0b8ae3ccac4c5b3664c4df61649029305c9
Author: Franck Villaume <[email protected]>
Date:   Sun Feb 21 17:43:30 2016 +0100

    use HTML helpers

diff --git a/src/www/admin/massmail.php b/src/www/admin/massmail.php
index 8fb600f..e3b774e 100644
--- a/src/www/admin/massmail.php
+++ b/src/www/admin/massmail.php
@@ -72,7 +72,7 @@ if (getStringFromRequest('action')) {
 
                        if (!$res || db_affected_rows($res)<1) {
                                
form_release_key(getStringFromRequest('form_key'));
-                               $error_msg = _('Scheduling Mailing, Could not 
schedule mailing, database error: ').db_error();
+                               $error_msg = _('Scheduling Mailing, Could not 
schedule mailing, database error')._(': ').db_error();
                        } else {
                                $systasksq = new SysTasksQ();
                                $systasksq->add(SYSTASK_CORE, 'MASSMAIL', null, 
user_getid());
@@ -90,7 +90,7 @@ if (getStringFromRequest('action')) {
                                                array($id));
                        if (!$res || db_affected_rows($res)<1) {
                                
form_release_key(getStringFromRequest('form_key'));
-                               $error_msg = _('Scheduling Mailing, Could not 
delete mailing, database error: ').db_error();
+                               $error_msg = _('Scheduling Mailing, Could not 
delete mailing, database error')._(': ').db_error();
                        } else {
                                $feedback = _('Mailing successfully deleted');
                        }
@@ -99,53 +99,44 @@ if (getStringFromRequest('action')) {
        }
 }
 
-$title = sprintf(_('Mail Engine for %s Subscribers'), forge_get_config 
('forge_name'));
-site_admin_header(array('title'=>$title));
-
-print '
-<p>
-<a href="#active">' ._('Active Deliveries').'</a>
-</p>
-
-<p>' ._('Be <span class="important">VERY</span> careful with this form, 
because submitting it WILL lead to sending email to lots of users.').
-'</p>
-';
-
-print '
-<form action="'.util_make_uri('/admin/massmail.php?action=add').'" 
method="post">'
-.'<input type="hidden" name="form_key" value="'.form_generate_key().'" />'
-.'<strong>'._('Target Audience').utils_requiredField()._(':').'</strong><br 
/>'.html_build_select_box_from_arrays(
-       array(0,'SITE','COMMNTY','DVLPR','ADMIN','ALL','SFDVLPR'),
-       array(
-               _('(select)'),
-               _('Subscribers to “Site Updates”'),
-               _('Subscribers to “Additional Community Mailings”'),
-               _('All Project Developers'),
-               _('All Project Admins'),
-               _('All Users'),
-               forge_get_config ('forge_name'). _('Developers (test)')
-       ),
-       'mail_type',false,false
-)
-.'<br />';
-
-print '
-
-<p>
-<strong>' ._('Subject').utils_requiredField()._(':').'</strong>
-<br /><input type="text" required="required" name="mail_subject" size="50" 
value="['.forge_get_config ('forge_name').'] " /></p>
-
-<p><strong>'._('Text of 
Message').utils_requiredField()._(':').'</strong>'._('(will be appended with 
unsubscription information, if applicable)').'</p>
-<pre><textarea required="required" name="mail_message" cols="70" rows="20">
-</textarea>
-</pre>
-
-<p><input type="submit" name="submit" value="' ._('Schedule for Mailing').'" 
/></p>
-
-</form>
-';
-
-$res = db_query_params ('
+$title = sprintf(_('Mail Engine for %s Subscribers'), 
forge_get_config('forge_name'));
+site_admin_header(array('title' => $title));
+
+echo html_e('p', array(), util_make_link('/admin/massmail.php#active', 
_('Active Deliveries')));
+echo html_e('p', array(), _('Be <span class="important">VERY</span> careful 
with this form, because submitting it WILL lead to sending email to lots of 
users.'));
+
+echo $HTML->openForm(array('action' => '/admin/massmail.php?action=add', 
'method' => 'post'))
+       .html_e('input', array('type' => 'hidden', 'name' => 'form_key', 
'value' => form_generate_key()))
+       .html_e('strong', array(), _('Target 
Audience').utils_requiredField()._(':'))
+       .html_e('br')
+       .html_build_select_box_from_arrays(
+                       
array(0,'SITE','COMMNTY','DVLPR','ADMIN','ALL','SFDVLPR'),
+                       array(
+                               _('(select)'),
+                               _('Subscribers to “Site Updates”'),
+                               _('Subscribers to “Additional Community 
Mailings”'),
+                               _('All Project Developers'),
+                               _('All Project Admins'),
+                               _('All Users'),
+                               forge_get_config('forge_name'). _('Developers 
(test)')
+                       ),
+                       'mail_type',false,false
+               )
+       .html_e('br');
+
+echo html_e('p', array(),
+               html_e('strong', array(), 
_('Subject').utils_requiredField()._(':'))
+               .html_e('br')
+               .html_e('input', array('type' => 'text', 'required' => 
'required', 'name' => 'mail_subject', 'size' => 50, 'value' => 
'['.forge_get_config('forge_name').']')));
+echo html_e('p', array(),
+               html_e('strong', array(), _('Text of 
Message').utils_requiredField()._(': '))._('(will be appended with 
unsubscription information, if applicable)'));
+
+echo html_e('textarea', array('required' => 'required', 'name' => 
'mail_message', 'cols' => 70, 'rows' => 20), '' , false);
+
+echo html_e('p', array(), html_e('input', array('type' => 'submit', 'value' => 
_('Schedule for Mailing'))));
+echo $HTML->closeForm();
+
+$res = db_query_params('
        SELECT *
        FROM massmail_queue
        WHERE finished_date=0
@@ -160,7 +151,7 @@ $title[]=_('Subject');
 $title[]=_('Date');
 $title[]=_('Last user_id mailed');
 
-print '<a name="active">'._('Active Deliveries')._(':').'</a>';
+echo html_e('h2', array('id' => 'active'), _('Active Deliveries')._(':'));
 
 $seen = false;
 
@@ -183,7 +174,7 @@ while ($row = db_fetch_array($res)) {
 if ($seen) {
        echo $HTML->listTableBottom();
 } else {
-       echo '<p>' . _('No deliveries active.') . "</p>\n";
+       echo $HTML->information(_('No deliveries active.'));
 }
 
 site_admin_footer();

-----------------------------------------------------------------------

Summary of changes:
 src/www/admin/massmail.php    |  93 +++++++++++++++++--------------------
 src/www/admin/unsubscribe.php | 105 +++++++++++++++++++-----------------------
 2 files changed, 90 insertions(+), 108 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to