Activating 'hidden' visibility flag.
authorVictor Berger <victor.berger@m4x.org>
Sun, 2 Feb 2014 16:56:30 +0000 (17:56 +0100)
committerVictor Berger <victor.berger@m4x.org>
Sun, 2 Feb 2014 16:56:30 +0000 (17:56 +0100)
Signed-off-by: Victor Berger <victor.berger@m4x.org>
htdocs/images/icons/flag_black.gif [new file with mode: 0644]
modules/profile.php
modules/profile/addresses.inc.php
modules/profile/jobs.inc.php
modules/profile/page.inc.php
templates/include/flags.radio.tpl
templates/profile/base.tpl

diff --git a/htdocs/images/icons/flag_black.gif b/htdocs/images/icons/flag_black.gif
new file mode 100644 (file)
index 0000000..eb7494c
Binary files /dev/null and b/htdocs/images/icons/flag_black.gif differ
index 467a99c..b7e70cf 100644 (file)
@@ -135,10 +135,10 @@ class ProfileModule extends PLModule
             if (!$user->hasProfile()) {
                 return PL_NOT_FOUND;
             } else {
-                $profile = $user->profile();
+                $profile = $user->profile(false,0,Visibility::get(Visibility::VIEW_ADMIN));
             }
         } else {
-            $profile = Profile::get($hrpid);
+            $profile = Profile::get($hrpid,0,Visibility::get(Visibility::VIEW_ADMIN));
         }
 
         if (!$profile) {
index ca113b6..fa005fb 100644 (file)
@@ -27,7 +27,7 @@ class ProfileSettingAddresses implements ProfileSetting
         $addresses = array();
 
         if (is_null($value)) {
-            $it = Address::iterate(array($page->pid()), array(Address::LINK_PROFILE), array(0), Visibility::get(Visibility::VIEW_PRIVATE));
+            $it = Address::iterate(array($page->pid()), array(Address::LINK_PROFILE), array(0), Visibility::get(Visibility::VIEW_ADMIN));
             while ($address = $it->next()) {
                 $addresses[] = $address->toFormArray();
             }
index 3c14655..43c70d1 100644 (file)
@@ -86,11 +86,11 @@ class ProfileSettingJob implements ProfileSetting
             $backtrack[$job['id']] = $key;
         }
 
-        $it = Address::iterate(array($page->pid()), array(Address::LINK_JOB), array(), Visibility::get(Visibility::VIEW_PRIVATE));
+        $it = Address::iterate(array($page->pid()), array(Address::LINK_JOB), array(), Visibility::get(Visibility::VIEW_ADMIN));
         while ($address = $it->next()) {
             $jobs[$address->id]['w_address'] = $address->toFormArray();
         }
-        $it = Phone::iterate(array($page->pid()), array(Phone::LINK_JOB), array(), Visibility::get(Visibility::VIEW_PRIVATE));
+        $it = Phone::iterate(array($page->pid()), array(Phone::LINK_JOB), array(), Visibility::get(Visibility::VIEW_ADMIN));
         while ($phone = $it->next()) {
             $jobs[$phone->link_id]['w_phone'][$phone->id] = $phone->toFormArray();
         }
index 9b3bbac..4dc9a1f 100644 (file)
@@ -108,7 +108,7 @@ class ProfileSettingPhones implements ProfileSetting
         $phones = array();
 
         if (is_null($value)) {
-            $it = Phone::iterate(array($page->pid()), array(Phone::LINK_PROFILE), array(0), Visibility::get(Visibility::VIEW_PRIVATE));
+            $it = Phone::iterate(array($page->pid()), array(Phone::LINK_PROFILE), array(0), Visibility::get(Visibility::VIEW_ADMIN));
             while ($phone = $it->next()) {
                 $success = ($phone->format() && $success);
                 $phones[] = $phone->toFormArray();
index 1f38ce4..729072e 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 {if t($withtext)}
-<a href="Xorg/FAQ?display=light#flags" class="popup_800x240">Quelle couleur ?</a>
+<a href="Xorg/FAQ?display=light#flags" class="popup_800x240">Quelle couleur ?</a><br />
 {/if}
 {if !t($val)}{assign var=val value='ax'}{/if}
 {if t($disabled)}<input type="hidden" name="{$name}" value="private" />{/if}
 <label><input type="radio" name="{$name}" value="public"{if $val eq 'public'} checked="checked"{/if}
        {if t($disabled)}disabled="disabled"{/if}{if t($mainField)} onchange="updatePublicity('{$mainField}','{$mainId}','{$subField}','{$subId}')"{/if} />
 {icon name="flag_green" title="site public"}
-{if t($withtext)}<span class="texte">site public</span>{/if}</label>
+{if t($withtext)}<span class="texte">annuaire papier</span>{/if}</label>
 <label><input type="radio" name="{$name}" value="ax"{if $val eq 'ax'} checked="checked"{/if}
        {if t($disabled)}disabled="disabled"{/if}{if t($mainField)} onchange="updatePublicity('{$mainField}','{$mainId}','{$subField}','{$subId}')"{/if} />
-{icon name="flag_orange" title="transmis à l'AX"}
-{if t($withtext)}<span class="texte">transmis à l'AX</span>{/if}</label>
+{icon name="flag_orange" title="visible dans l'annuaire papier"}
+{if t($withtext)}<span class="texte">visible dans l'annuaire papier</span>{/if}</label>
 <label><input type="radio" name="{$name}" value="private"{if $val eq 'private'} checked="checked"{/if}
        {if t($disabled)}disabled="disabled"{/if}{if t($mainField)} onchange="updatePublicity('{$mainField}','{$mainId}','{$subField}','{$subId}')"{/if} />
-{icon name="flag_red" title="privé"}
-{if t($withtext)}<span class="texte">privé</span>{/if}</label>
+{icon name="flag_red" title="authentifié"}
+{if t($withtext)}<span class="texte">diplômés de l'X</span>{/if}</label>
+<label><input type="radio" name="{$name}" value="hidden"{if $val eq 'hidden'} checked="checked"{/if}
+       {if t($disabled)}disabled="disabled"{/if}{if t($mainField)} onchange="updatePublicity('{$mainField}','{$mainId}','{$subField}','{$subId}')"{/if} />
+{icon name="flag_black" title="administrateurs"}
+{if t($withtext)}<span class="texte">administrateurs</span>{/if}</label>
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index af94064..55c459e 100644 (file)
   {xsrf_token_field}
   <div>
     {icon name=information title="Voir ma fiche"} Tu peux consulter
-    {if $isMe}ta{else}cette{/if} fiche telle que la
-    voient <a class="popup2" href="profile/{$profile->hrpid}?view=public">n'importe quel internaute</a>,
-    <a class="popup2" href="profile/{$profile->hrpid}?view=ax">l'AX</a>{if $viewPrivate}ou
-    <a class="popup2" href="profile/{$profile->hrpid}">les X</a>{/if}.
+    {if $isMe}ta{else}cette{/if} fiche telle qu'elle apparaît
+    <a class="popup2" href="profile/{$profile->hrpid}?view=public">pour n'importe quel internaute</a>,
+    <a class="popup2" href="profile/{$profile->hrpid}?view=ax">dans l'annuaire papier</a>{if $viewPrivate} ou
+    <a class="popup2" href="profile/{$profile->hrpid}">pour les X</a>{/if}.
   </div>
   <div class="flags">
   {include file="include/flags.radio.tpl" disabled=true withtext=true val="novalue" name="profile_ex_pub"}