Exemple #1
0
        }
        $this->lstTypes = new QListBox($this);
        $this->lstTypes->AddItem('- View All Types -', null);
        $this->lstTypes->AddAction(new QChangeEvent(), new QAjaxAction('dtrGrowthGroups_Bind'));
        foreach (GrowthGroupStructure::LoadAll(QQ::OrderBy(QQN::GrowthGroupStructure()->Name)) as $objStructure) {
            $this->lstTypes->AddItem($objStructure->Name, $objStructure->Id);
        }
    }
    public function dtrGrowthGroups_Bind()
    {
        $objCondition = QQ::Equal(QQN::GrowthGroup()->GrowthGroupLocationId, $this->objLocation->Id);
        if ($this->lstDays->SelectedValue) {
            $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->GrowthGroupDayTypeId, $this->lstDays->SelectedValue));
        }
        if ($this->lstTypes->SelectedValue) {
            $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->GrowthGroupStructure->GrowthGroupStructureId, $this->lstTypes->SelectedValue));
        }
        // Filter Out "inactive" groups
        $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->Group->ActiveFlag, true));
        $this->dtrGrowthGroups->DataSource = GrowthGroup::QueryArray($objCondition, QQ::OrderBy(QQN::GrowthGroup()->Group->Name));
        // Results?
        $this->pnlNone->Visible = !count($this->dtrGrowthGroups->DataSource);
        // Markers
        QApplication::ExecuteJavaScript('hideAllMarkers();');
        foreach ($this->dtrGrowthGroups->DataSource as $objGroup) {
            QApplication::ExecuteJavaScript('showMarker(' . ($this->intMarkerArray[$objGroup->GroupId] - 1) . ');');
        }
    }
}
MapForm::Run('MapForm');
Exemple #2
0
echo $OUTPUT->header('themeselector');
if ($idMap) {
    $webgdCommunityDao = new WebgdCommunityDao();
    if (!$webgdCommunityDao->searchMentalMapByCommunityByIdByUser($idCommunity, $idMap, $USER->id)) {
        redirect("{$CFG->wwwroot}/blocks/webgd_community/view.php?community={$idCommunity}&option=2&suboption=1", 'Mapa mental não encontrado', 10);
        echo $OUTPUT->footer();
        die;
    } else {
        echo $OUTPUT->heading('<span class="titulo_list">' . '<a href="' . $url . '" >' . $OUTPUT->heading($community->name, 2, 'titulo_comunidade') . '</a></span><br/>');
        echo "<div class='subTitle'>Editar Mapa mental</div><br/>";
    }
} else {
    echo $OUTPUT->heading('<span class="titulo_list">' . '<a href="' . $url . '" >' . $OUTPUT->heading($community->name, 2, 'titulo_comunidade') . '</a></span><br/>');
    echo "<div class='subTitle'>Cadastrar Atividade</div><br/>";
}
$mform = new MapForm(null, array('community' => $idCommunity, 'map' => $idMap));
if ($data = $mform->get_data()) {
    $msg = "";
    if ($idMap) {
        $map = $webgdCommunityDao->searchMentalMapByCommunityById($idMap);
        $map->name = $data->nome;
        $map->url = $data->link;
        $msg = "Ocorreu um erro ao editar o link";
        if ($DB->update_record(TableResouces::$TABLE_PAGE_COMMUNITY_LINKS, $map)) {
            $msg = "Link editado com sucesso";
        }
    } else {
        try {
            $transaction = $DB->start_delegated_transaction();
            $post = new stdClass();
            $post->community = $idCommunity;