$res = XDB::query('SELECT a.*, d.nom AS domnom,
FIND_IN_SET(\'wiki_desc\', a.flags) AS wiki_desc,
FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub,
- (nls.id IS NOT NULL) AS has_nl
+ (nls.id IS NOT NULL) AS has_nl,
+ p.display_tel AS phone, f.display_tel AS fax
FROM groups AS a
LEFT JOIN group_dom AS d ON d.id = a.dom
LEFT JOIN newsletters AS nls ON (nls.group_id = a.id)
+ LEFT JOIN profile_phones AS p ON (p.link_type = \'group\' AND p.link_id = a.id AND p.tel_id = 0)
+ LEFT JOIN profile_phones AS f ON (f.link_type = \'group\' AND f.link_id = a.id AND f.tel_id = 1)
WHERE ' . $where);
if ($res->numRows() != 1) {
if ($can_be_shortname && (is_int($id) || ctype_digit($id))) {
const LINK_ADDRESS = 'address';
const LINK_PROFILE = 'user';
const LINK_COMPANY = 'hq';
+ const LINK_GROUP = 'group';
/** The following fields, but $error, all correspond to the fields of the
* database table profile_phones.
$globals->asso('id'));
}
+ Phone::deletePhones(0, Phone::LINK_GROUP, $globals->asso('id'));
+ $phone = new Phone(array('link_type' => 'group', 'link_id' => $globals->asso('id'), 'id' => 0,
+ 'type' => 'fixed', 'display' => Post::v('phone'), 'pub' => 'public'));
+ $fax = new Phone(array('link_type' => 'group', 'link_id' => $globals->asso('id'), 'id' => 1,
+ 'type' => 'fax', 'display' => Post::v('fax'), 'pub' => 'public'));
+ $phone->save();
+ $fax->save();
if ($_FILES['logo']['name']) {
$upload = PlUpload::get($_FILES['logo'], $globals->asso('id'), 'asso.logo', true);
</tr>
{/if}
+ {if $asso->phone}
+ <tr>
+ <td class="titre">Téléphone :</td>
+ <td>{$asso->phone}</td>
+ </tr>
+ {/if}
+
+ {if $asso->fax}
+ <tr>
+ <td class="titre">Fax :</td>
+ <td>{$asso->fax}</td>
+ </tr>
+ {/if}
+
{if !$is_member && $is_logged && $asso->inscriptible && $xnet_type != 'promotions'}
<tr>
<td class="titre">
</tr>
<tr>
+ <td class="titre">Téléphone</td>
+ <td>
+ <input type="text" maxlength="28" name="phone" value="{$asso->phone}" />
+ </td>
+ </tr>
+ <tr>
+ <td class="titre">Fax</td>
+ <td>
+ <input type="text" maxlength="28" name="fax" value="{$asso->fax}" />
+ </td>
+ </tr>
+
+ <tr>
<td class="titre">
Forum :
</td>
--- /dev/null
+ALTER TABLE profile_phones CHANGE COLUMN link_type link_type ENUM('address','pro','user','hq', 'group') NOT NULL DEFAULT 'user';
+
+-- vim:set syntax=mysql: