function ValidateIterator ()
{
- parent::XOrgDBIterator('SELECT data,stamp FROM requests ORDER BY stamp', MYSQL_NUM);
+ parent::__construct('SELECT data,stamp FROM requests ORDER BY stamp', MYSQL_NUM);
}
// }}}
function commit()
{
- $list = new List(S::v('uid'), S::v('password'));
+ $list = new MMList(S::v('uid'), S::v('password'));
$ret = $list->create_list($this->liste, $this->desc, $this->advertise,
$this->modlevel, $this->inslevel,
$this->owners, $this->members);
class VCard
{
var $users = array();
+ var $photos;
- function VCard($users, $freetext = null)
+ function VCard($users, $photos = true, $freetext = null)
{
+ $this->photos = $photos;
if (is_array($users)) {
foreach ($users as $user) {
$this->add_user($user, $freetext);
$user['virtualalias'] = $res->fetchOneCell();
// get photo
- $res = XDB::query(
- "SELECT attach, attachmime
- FROM photo AS p
- INNER JOIN aliases AS a ON (a.id = p.uid AND a.type = 'a_vie')
- WHERE a.alias = {?}", $login);
- if ($res->numRows()) {
- $user['photo'] = $res->fetchOneAssoc();
+ if ($this->photos) {
+ $res = XDB::query(
+ "SELECT attach, attachmime
+ FROM photo AS p
+ INNER JOIN aliases AS a ON (a.id = p.uid AND a.type = 'a_vie')
+ WHERE a.alias = {?}", $login);
+ if ($res->numRows()) {
+ $user['photo'] = $res->fetchOneAssoc();
+ }
}
$this->users[] = $user;
}
header('Content-Type: text/calendar; charset=utf-8');
}
- function handler_vcard(&$page)
+ function handler_vcard(&$page, $photos = null)
{
$res = XDB::query('SELECT contact
FROM contacts
WHERE uid = {?}', S::v('uid'));
+
require_once('vcard.inc.php');
- $vcard = new VCard($res->fetchColumn());
+ $vcard = new VCard($res->fetchColumn(), $photos == 'photos');
$vcard->do_page(&$page);
}
}
$page->assign('ann', $ann);
}
- function handler_vcard(&$page)
+ function handler_vcard(&$page, $photos = null)
{
global $globals;
FROM groupex.membres
WHERE asso_id = {?}', $globals->asso('id'));
require_once('vcard.inc.php');
- $vcard = new VCard($res->fetchColumn(), 'Membre du groupe ' . $globals->asso('nom'));
+ $vcard = new VCard($res->fetchColumn(), $photos == 'photos', 'Membre du groupe ' . $globals->asso('nom'));
$vcard->do_page($page);
} else {
return PL_NOTALLOWED;
</li>
<li>
{icon name=vcard title='Carte de visite'}
- <a href="carnet/contacts/vcard/MesContactsXorg.vcf">
- La carte de visite permettant de les insérer dans ton carnet d'adresse
- </a>
+ <a href="carnet/contacts/vcard/photos/MesContactsXorg.vcf">La carte de visite électronique</a>
+ (<a href="carnet/contacts/vcard/MesContactsXorg.vcf">sans les photos</a>)
</li>
</ul>
</p>
<ul class="descr">
<li>
- <a href="{$platal->ns}annuaire/vcard/{$asso.diminutif}.vcf">
+ <a href="{$platal->ns}annuaire/vcard/photos/{$asso.diminutif}.vcf">
{icon name=vcard title="Carte de visite"}
Ajouter les membres à ton carnet d'adresse
</a>
+ (<a href="{$platal->ns}annuaire/vcard/{$asso.diminutif}.vcf">sans les photos</a>)
</li>
{if $admin}
<li>