예제 #1
0
function check_valid_asessment($source_guid, $target_guid, $trip_guid)
{
    $x = check_available_user($source_guid, $trip_guid);
    $y = check_available_user($target_guid, $trip_guid);
    if ($x && $y) {
        $val = trip_companions_check_assessment($source_guid, $target_guid, $trip_guid);
        //system_message("---- ".$val);
        if ($val > -1) {
            //now depends on the configuration on board
            if (elgg_get_plugin_setting('allowMany', 'hflts') != 0) {
                //> one
                return true;
            } else {
                return false;
            }
        } else {
            return true;
        }
    }
    return false;
}
예제 #2
0
    }
}
// notification info
if (elgg_is_active_plugin('notifications') && $is_member) {
    if ($subscribed) {
        elgg_register_menu_item('mytrips:my_status', array('name' => 'subscription_status', 'text' => elgg_echo('mytrips:subscribed'), 'href' => "notifications/trip/{$user->username}", 'is_action' => true));
    } else {
        elgg_register_menu_item('mytrips:my_status', array('name' => 'subscription_status', 'text' => elgg_echo('mytrips:unsubscribed'), 'href' => "notifications/trip/{$user->username}"));
    }
}
$body = elgg_view_menu('mytrips:my_status');
$grade_status = "";
//To do. Se debe comprobar que el viaje ya se ha realizado (lo que hablamos de pasarlo a una pesataña histórico)
//y se puede contestar la encuesta de valoracion. Entonces tendrá sentido el else. Ahora lo dejo para que se muestre claramente el status
elgg_load_library('elgg:trip_companions');
if (check_available_user($user->guid, $trip->guid)) {
    foreach ($trip->confirmed as $key => $value) {
        if ($value == "_" || $value == "") {
            continue;
        } else {
            if ($user->guid != $value) {
                $bro = get_user($value);
                //the other
                $key = trip_companions_check_assessment($user->guid, $bro->guid, $trip->guid);
                if ($key > -1) {
                    $grade_status .= '<div class="elgg-subtext">' . elgg_echo('mytrips:my_status:grade') . $bro->name . '</div>';
                } else {
                    $grade_status .= '<div class="elgg-subtext">' . elgg_echo('mytrips:my_status:grade:pending') . $bro->name . '</div>';
                }
            }
        }