Bug/Wish:
* Admin:
+ - #390: Add date of request in validation form. -FRU
+ - #397: Can edit death date in user admin page. -FRU
+ - #427: Automatic answers for validation. -Car
+ - #429: Tools to administrate duplicated adresses. -FRU
- #430: Specify date format on downtime admin page. -Car
- - #397: Can edit death date in user admin page -FRU
- - #429: Tools to administrate duplicated adresses -FRU
- - #390: Add date of request in validation form -FRU
- - #440: Rewrite events admin page -FRU
+ - #440: Rewrite events admin page. -FRU
* Carnet:
- #435: Calendar contains yearly events for all the contacts. -FRU
- #426: Add an identification header in mails. -FRU
* Lists:
- - #127: Add promo in member list when sorted by name -FRU
- - #423: Allow line breaks in mailing list descriptions -FRU
+ - #127: Add promo in member list when sorted by name. -FRU
+ - #423: Allow line breaks in mailing list descriptions. -FRU
* Profile:
- #344: Tels can be bigger (up to 30 chars). -Car
- - #422: Parasitic strings in vcard -FRU
+ - #422: Parasitic strings in vcard. -FRU
* Xnet:
- #426: Add an identification header in mails. -FRU
- - #384: substitution of non-X's names in mail from web interface -FRU
- - #380: Add sex for non-X -FRU
+ - #384: Substitution of non-X's names in mail from web interface. -FRU
+ - #380: Add sex for non-X. -FRU
From 0.9.10 Branch:
{ return null; }
// }}}
+ // {{{ function answers()
+
+ /** automatic answers table for this type of validation */
+ function answers() {
+ static $answers_table;
+ if (!isset($answers_table[$this->type])) {
+ $r = XDB::query("SELECT id, title, answer FROM requests_answers WHERE category = {?}", $this->type);
+ $answers_table[$this->type] = $r->fetchAllAssoc($r);
+ }
+ return $answers_table[$this->type];
+ }
+
+ // }}}
}
foreach (glob(dirname(__FILE__).'/validations/*.inc.php') as $file) {
'admin/synchro_ax' => $this->make_hook('synchro_ax', AUTH_MDP, 'admin'),
'admin/user' => $this->make_hook('user', AUTH_MDP, 'admin'),
'admin/validate' => $this->make_hook('validate', AUTH_MDP, 'admin'),
+ 'admin/validate/answers' => $this->make_hook('validate_answers', AUTH_MDP, 'admin'),
'admin/wiki' => $this->make_hook('wiki', AUTH_MDP, 'admin'),
);
}
$page->assign('vit', new ValidateIterator());
}
+ function handler_validate_answers(&$page, $action = 'list', $id = null) {
+ require_once('../classes/PLTableEditor.php');
+ $page->assign('xorg_title','Polytechnique.org - Administration - Réponses automatiques de validation');
+ $page->assign('title', 'Gestion des réponses automatiques');
+ $table_editor = new PLTableEditor('admin/validate/answers','requests_answers','id');
+ $table_editor->describe('category','catégorie',true);
+ $table_editor->describe('title','titre',true);
+ $table_editor->describe('answer','texte',false);
+ $table_editor->apply($page, $action, $id);
+ }
function handler_skins(&$page, $action = 'list', $id = null) {
require_once('../classes/PLTableEditor.php');
$page->assign('xorg_title','Polytechnique.org - Administration - Skins');
</tr>
<tr><th colspan='2'>Réponse</th></tr>
<tr>
- <td colspan='2' class='center' {popup caption="Règles de validation" text=$valid->rules}>
+ <td colspan='2' {popup caption="Règles de validation" text=$valid->rules}>
<form action="admin/validate" method="post">
<div>
+ Réponse préremplie :
+ <select onchange="this.form.comm.value=this.value">
+ <option value=""></option>
+ {foreach from=$valid->answers() item=automatic_answer}
+ <option value="{$automatic_answer.answer}">{$automatic_answer.title}</option>
+ {/foreach}
+ </select>
+ <a href="admin/validate/answers">{icon name="page_edit" title="Editer les réponses automatiques"}</a>
+ </div>
+ <div class='center'>
Ajouté dans l'email :<br />
<textarea rows="5" cols="50" name="comm"></textarea><br />
--- /dev/null
+CREATE TABLE `requests_answers` (\r
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,\r
+`category` ENUM( 'alias', 'list', 'nomusage', 'photo', 'evt', 'marketing', 'orange', 'homonyme', 'nl', 'paiement' ) NOT NULL ,\r
+`title` VARCHAR( 50 ) NOT NULL ,\r
+`answer` TEXT NOT NULL\r
+);\r