.. Reference: http://agiletoolkit.org/doc/ref *ATK4***************************************************** This file is part of Agile Toolkit 4 http://agiletoolkit.org (c) 2008-2011 Agile Technologies Ireland Limited Distributed under Affero General Public License v3 If you are using this file in YOUR web software, you must make your make source code for YOUR web software public. See LICENSE.txt for more information You can obtain non-public copy of Agile Toolkit 4 at http://agiletoolkit.org/commercial ****************************************************ATK4*
Inheritance: extends Filter
Ejemplo n.º 1
0
 /**
  * Adds QuickSearch to the grid.
  *
  * @param array  $fields  array of fieldnames used in quick search
  * @param array  $options optional options array
  * @param string $class   optional quick search object class
  * @param string $spot    optional template spot
  *
  * @return QuickSearch
  */
 public function addQuickSearch($fields, $options = null, $class = null, $spot = null)
 {
     // add only once
     // @todo decide, maybe we should destroy and recreate to keep last one
     if ($this->quick_search) {
         return $this->quick_search;
     }
     $this->quick_search = $this->add($class ?: $this->quick_search_class, $options, $spot ?: 'quick_search');
     /** @type QuickSearch $this->quick_search */
     $this->quick_search->useWith($this)->useFields($fields);
     return $this->quick_search;
 }
Ejemplo n.º 2
0
 /**
  * the one action which is called by the QuickSearch-form when typed in
  * by user.
  *
  * @param string query_id first argument of url -> id of query in session
  */
 public function response_action($query_id)
 {
     try {
         $needle = Request::get('request');
         $form_data = iterator_to_array(Request::getInstance());
         $this->search = QuickSearch::getFromSession($query_id);
         $results = $this->getResults($needle, $form_data);
         $this->render_json($results);
     } catch (Exception $e) {
         $this->set_status(500);
         $this->render_text($e->getMessage());
     }
 }
Ejemplo n.º 3
0
echo URLHelper::getLink('dispatch.php/search/courses', array('send' => 'yes', 'group_by' => '0') + $link_params);
?>
" method="post">
                    <?php 
echo CSRFProtection::tokenTag();
?>
                    <script>
                        var selectSem = function (seminar_id, name) {
                            document.location = "<?php 
echo URLHelper::getURL("dispatch.php/course/details/", array("send_from_search" => 1, "send_from_search_page" => URLHelper::getURL("dispatch.php/search/courses?keep_result_set=1")));
?>
&sem_id=" + seminar_id;
                        };
                    </script>
                    <?php 
print QuickSearch::get("search_sem_quick_search", new SeminarSearch())->setAttributes(array("title" => sprintf(_('Nach Veranstaltungen suchen (%s)'), htmlready($search_semester_name)), "class" => "quicksearchbox"))->fireJSFunctionOnSelect("selectSem")->noSelectbox()->render();
//Komisches Zeugs, das die StmBrowse.class.php braucht:
print '<input type="hidden" name="search_sem_1508068a50572e5faff81c27f7b3a72f" value="1">';
//Ende des komischen Zeugs.
?>
                    <input type="hidden" name="search_sem_sem" value="<?php 
echo $search_semester_nr;
?>
">
                    <input type="hidden" name="search_sem_qs_choose" value="title_lecturer_number">
                    <?php 
echo Icon::create('search', 'info_alt', ['title' => sprintf(_('Nach Veranstaltungen suchen (%s)'), htmlready($search_semester_name))])->asInput(["type" => "image", "class" => "quicksearchbutton", "name" => "search_sem_do_search", "value" => "OK"]);
?>
                </form>
            </li>
        <? endif ?>
Ejemplo n.º 4
0
    ?>
][]" value="<?php 
    echo $lecturer;
    ?>
">
            <?php 
    echo Assets::input('icons/16/black/trash.png', array('name' => 'delete_lecturer[' . $i . '][' . $lecturer . ']'));
    ?>
            <br>
        <? endforeach;?>
            <div style="float:left">
                <?php 
    echo Assets::input('icons/16/yellow/arr_2up.png', array('name' => 'add_lecturer[' . $i . ']'));
    ?>
            </div>
<? echo QuickSearch::get("add_doz_" . $i, $to_copy['search_lecturer'][$i])
                            ->withButton(array('search_button_name' => 'search_doz', 'reset_button_name' => 'reset_search'))
                            ->render();
                            ?>

        </div>
        </li>
    <?endfor;?>
    </ol>
    <div style="text-align:center">
    <?php 
    echo Studip\Button::createAccept(_('Kopieren'), 'do_copy');
    ?>
    <?php 
    echo Studip\LinkButton::createCancel(_('Abbrechen'), '?');
    ?>
Ejemplo n.º 5
0
                        <li>
                            <label>
                                <input type="checkbox" name="remove_inst[]" value="<?php 
echo htmlReady($assignment['range_id']);
?>
" style="display: none;">
                                <span><?php 
echo htmlReady(Institute::find($assignment['range_id'])->name);
?>
</span>
                                <?php 
echo Assets::img("icons/16/blue/trash", array('class' => "text-bottom", 'title' => _("Zuweisung zur Einrichtung aufheben.")));
?>
                            </label>
                        </li>
                    <? endif ?>
                <? endforeach ?>
            </ul>
            <?php 
echo QuickSearch::get("add_institut_id", new SeminarSearch())->render();
?>
        <? endif ?>

    </fieldset>

    <div data-dialog-button>
        <?php 
echo \Studip\Button::create(_("Speichern"), 'questionnaire_store_relations');
?>
    </div>
</form>
Ejemplo n.º 6
0
?>
">
                <span class="visual">
                    <?php 
echo htmlReady($user['fullname']);
?>
                </span>
                <a class="remove_adressee"><?php 
echo Icon::create('trash', 'clickable')->asImg(['class' => "text-bottom"]);
?>
</a>
            </li>
            <? endforeach ?>
        </ul>
        <?php 
echo QuickSearch::get("user_id", new StandardSearch("user_id"))->fireJSFunctionOnSelect("STUDIP.Messages.add_adressee")->withButton()->render();
$search_obj = new SQLSearch("SELECT auth_user_md5.user_id, {$GLOBALS['_fullname_sql']['full_rev']} as fullname, username, perms " . "FROM auth_user_md5 " . "LEFT JOIN user_info ON (auth_user_md5.user_id = user_info.user_id) " . "WHERE " . "username LIKE :input OR Vorname LIKE :input " . "OR CONCAT(Vorname,' ',Nachname) LIKE :input " . "OR CONCAT(Nachname,' ',Vorname) LIKE :input " . "OR CONCAT(Nachname,', ',Vorname) LIKE :input " . "OR Nachname LIKE :input OR " . "OR Vorname LIKE :input" . " ORDER BY fullname ASC", _("Nutzer suchen"), "user_id");
$mps = MultiPersonSearch::get("add_adressees")->setLinkText(_('Mehrere Adressaten hinzufügen'))->setTitle(_('Mehrere Adressaten hinzufügen'))->setExecuteURL(URLHelper::getURL("dispatch.php/messages/write"))->setJSFunctionOnSubmit("STUDIP.Messages.add_adressees")->setSearchObject($search_obj);
foreach (Statusgruppen::findContactGroups() as $group) {
    $mps->addQuickfilter($group['name'], $group->members->pluck('user_id'));
}
echo $mps->render();
?>
        <script>
            STUDIP.MultiPersonSearch.init();
        </script>
    </div>
    <div>
        <label>
            <h4><?php 
echo _("Betreff");
Ejemplo n.º 7
0
                    'data': { 'seminar_id': seminar_id },
                    'dataType': "json",
                    'success': function (json) {
                        jQuery("#topiclist").html(json.html);
                    }
                });
                return true;
            }
        };
    </script>
    <div style="text-align: center;">
        <?php 
echo Icon::create('seminar', 'clickable')->asImg(20, ['class' => "text-bottom"]);
?>
        <?php 
echo QuickSearch::get("copy_from", $courseSearch)->fireJSFunctionOnSelect("STUDIP.Topics.loadTopics")->render();
?>
    </div>
    <div id="topiclist" style="min-height: 50px; text-align: center;">
        <? if (Request::option("seminar_id")) : ?>
        <?php 
echo $this->render_partial("_topiclist.php", array('topics' => CourseTopics::findBySeminar_id(Request::option("seminar_id"))));
?>
        <? endif ?>
    </div>
    <div align="center" data-dialog-button>
        <?php 
echo \Studip\Button::create(_("kopieren"), 'copy');
?>
    </div>
Ejemplo n.º 8
0
 /**
  * Displays edit form and performs according actions upon submit
  *
  * @param int    $banner_id Id from the banner-object
  */
 public function edit_action($banner_id)
 {
     $banner = Banner::find($banner_id);
     if ($banner === null) {
         throw new Exception(sprintf(_('Es existiert kein Banner mit der Id "%s"'), $banner_id));
     }
     // edit banner input
     if (Request::submitted('speichern')) {
         $banner_path = Request::get('banner_path');
         $description = Request::get('description');
         $alttext = Request::get('alttext');
         $target_type = Request::get('target_type');
         $priority = Request::int('priority');
         //add the right target
         if ($target_type == 'url') {
             $target = Request::get('target');
         } else {
             if ($target_type == 'inst') {
                 $target = Request::option('institut');
             } else {
                 if ($target_type == 'user') {
                     $target = Request::username('user');
                 } else {
                     if ($target_type == 'seminar') {
                         $target = Request::option('seminar');
                     } else {
                         $target = Request::get('target');
                     }
                 }
             }
         }
         $errors = array();
         //upload file
         $upload = $_FILES['imgfile'];
         if (!empty($upload['name'])) {
             $banner_path = $this->bannerupload($upload['tmp_name'], $upload['size'], $upload['name'], $errors);
         }
         if (!$target && $target_type != 'none') {
             $errors[] = _('Es wurde kein Verweisziel angegeben.');
         }
         $startDate = explode('.', Request::get('start_date'));
         if (($x = $this->valid_date(Request::int('start_hour'), Request::int('start_minute'), $startDate[0], $startDate[1], $startDate[2])) == -1) {
             $errors[] = _('Bitte geben Sie einen gültiges Startdatum ein.');
         } else {
             $startdate = $x;
         }
         $endDate = explode('.', Request::get('end_date'));
         if (($x = $this->valid_date(Request::int('end_hour'), Request::int('end_minute'), $endDate[0], $endDate[1], $endDate[2])) == -1) {
             $errors[] = _('Bitte geben Sie einen gültiges Enddatum ein.');
         } else {
             $enddate = $x;
         }
         switch ($target_type) {
             case 'url':
                 if (!preg_match('~^(https?|ftp)://~i', $target)) {
                     $errors[] = _('Das Verweisziel muss eine gültige URL sein (incl. http://).');
                 }
                 break;
             case 'inst':
                 if (Institute::find($target) === null) {
                     $errors[] = _('Die angegebene Einrichtung existiert nicht. ' . 'Bitte geben Sie eine gültige Einrichtungs-ID ein.');
                 }
                 break;
             case 'user':
                 if (User::findByUsername($target) === null) {
                     $errors[] = _('Der angegebene Username existiert nicht.');
                 }
                 break;
             case 'seminar':
                 try {
                     Seminar::getInstance($target);
                 } catch (Exception $e) {
                     $errors[] = _('Die angegebene Veranstaltung existiert nicht. ' . 'Bitte geben Sie eine gültige Veranstaltungs-ID ein.');
                 }
                 break;
             case 'none':
                 $target = '';
                 break;
         }
         if (count($errors) > 0) {
             PageLayout::postMessage(MessageBox::error(_('Es sind folgende Fehler aufgetreten:'), $errors));
         } else {
             $banner->banner_path = $banner_path;
             $banner->description = $description;
             $banner->alttext = $alttext;
             $banner->target_type = $target_type;
             $banner->target = $target;
             $banner->startdate = $startdate;
             $banner->enddate = $enddate;
             $banner->priority = $priority;
             $banner->store();
             PageLayout::postMessage(MessageBox::success(_('Der Banner wurde erfolgreich gespeichert.')));
             $this->redirect('admin/banner');
         }
     }
     if ($banner['target_type'] == 'seminar') {
         $seminar_name = get_object_name($banner['target'], 'sem');
         $this->seminar = QuickSearch::get('seminar', new StandardSearch('Seminar_id'))->setInputStyle('width: 240px')->defaultValue($banner['target'], $seminar_name['name'])->render();
     }
     if ($banner['target_type'] == 'user') {
         $this->user = QuickSearch::get('user', new StandardSearch('username'))->setInputStyle('width: 240px')->defaultValue($banner['target'], $banner['target'])->render();
     }
     if ($banner['target_type'] == 'inst') {
         $institut_name = get_object_name($banner['target'], 'inst');
         $this->institut = QuickSearch::get('institut', new StandardSearch('Institut_id'))->setInputStyle('width: 240px')->defaultValue($banner['target'], $institut_name['name'])->render();
     }
     $this->banner = $banner;
 }
Ejemplo n.º 9
0
?>
">
    <table class="default">
        <thead>
            <tr>
                <th colspan="2"><?php 
echo sprintf(_('%s suchen'), htmlReady($decoratedStatusGroups['dozent']));
?>
</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    <?php 
echo QuickSearch::get('new_dozent', $search)->withButton(array('reset_button_name' => 'reset_dozent', 'search_button_name' => 'search_dozent'))->render();
?>
  
                    <input type="hidden" name="seminar_id" value="<?php 
echo $course_id;
?>
">
                </td>

                <td>
<?php 
echo Button::createAccept(_('Eintragen'), 'add_dozent', array('title' => sprintf(_("als %s eintragen"), htmlReady($decoratedStatusGroups['dozent']))));
echo LinkButton::createCancel(_('Abbrechen'), $controller->url_for('course/members/index'));
?>
                </td>
            </tr>
Ejemplo n.º 10
0
                </a>
                <br>
                <label>
                    <input type="checkbox" value="1" name="smsforward_copy"
                        <? if ($user->smsforward_copy) echo 'checked'; ?>>
                    <?php 
echo _('Kopie im persönlichen Posteingang speichern.');
?>
                </label>
            <? else: ?>
                <label>
                    <?php 
echo _('Weiterleitung empfangener Nachrichten');
?>
                    <?php 
echo QuickSearch::get('new_smsforward_rec', new StandardSearch('username'))->withButton()->render();
?>
                </label>
            <? endif; ?>
        </div>

        <label style="clear:both;">
            <?php 
echo _('Signatur');
?>
            <textarea name="sms_sig" aria-label="<?php 
echo _('Signatur');
?>
"><?php 
echo htmlready($settings['sms_sig']);
?>
Ejemplo n.º 11
0
    public function quickSearch()
    {
        /* Bail out to prevent an error if the GET string doesn't even contain
         * a field named 'quickSearchFor' at all.
         */
        if (!isset($_GET['quickSearchFor']))
        {
            CommonErrors::fatal(COMMONERROR_BADFIELDS, $this, 'No query string specified.');
        }

        $query = trim($_GET['quickSearchFor']);
        $wildCardQuickSearch = $query;
        
        $search = new QuickSearch($this->_siteID);
        $candidatesRS = $search->candidates($query);
        $companiesRS  = $search->companies($query);
        $contactsRS   = $search->contacts($query);
        $jobOrdersRS  = $search->jobOrders($query);
        //$listsRS      = $search->lists($query);

        if (!empty($candidatesRS))
        {
            foreach ($candidatesRS as $rowIndex => $row)
            {
                if (!empty($candidatesRS[$rowIndex]['ownerFirstName']))
                {
                    $candidatesRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName(
                        $candidatesRS[$rowIndex]['ownerFirstName'],
                        $candidatesRS[$rowIndex]['ownerLastName'],
                        false,
                        LAST_NAME_MAXLEN
                    );
                }
                else
                {
                    $candidatesRS[$rowIndex]['ownerAbbrName'] = 'None';
                }

                if (empty($candidatesRS[$rowIndex]['phoneHome']))
                {
                    $candidatesRS[$rowIndex]['phoneHome'] = 'None';
                }

                if (empty($candidatesRS[$rowIndex]['phoneCell']))
                {
                    $candidatesRS[$rowIndex]['phoneCell'] = 'None';
                }
            }
        }

        if (!empty($companiesRS))
        {
            foreach ($companiesRS as $rowIndex => $row)
            {
                if (!empty($companiesRS[$rowIndex]['ownerFirstName']))
                {
                    $companiesRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName(
                        $companiesRS[$rowIndex]['ownerFirstName'],
                        $companiesRS[$rowIndex]['ownerLastName'],
                        false,
                        LAST_NAME_MAXLEN
                    );
                }
                else
                {
                    $companiesRS[$rowIndex]['ownerAbbrName'] = 'None';
                }

                if (empty($companiesRS[$rowIndex]['phone1']))
                {
                    $companiesRS[$rowIndex]['phone1'] = 'None';
                }
            }
        }

        if (!empty($contactsRS))
        {
            foreach ($contactsRS as $rowIndex => $row)
            {

                if ($contactsRS[$rowIndex]['isHotContact'] == 1)
                {
                    $contactsRS[$rowIndex]['linkClassContact'] = 'jobLinkHot';
                }
                else
                {
                    $contactsRS[$rowIndex]['linkClassContact'] = 'jobLinkCold';
                }

                if ($contactsRS[$rowIndex]['leftCompany'] == 1)
                {
                    $contactsRS[$rowIndex]['linkClassCompany'] = 'jobLinkDead';
                }
                else if ($contactsRS[$rowIndex]['isHotCompany'] == 1)
                {
                    $contactsRS[$rowIndex]['linkClassCompany'] = 'jobLinkHot';
                }
                else
                {
                    $contactsRS[$rowIndex]['linkClassCompany'] = 'jobLinkCold';
                }

                if (!empty($contactsRS[$rowIndex]['ownerFirstName']))
                {
                    $contactsRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName(
                        $contactsRS[$rowIndex]['ownerFirstName'],
                        $contactsRS[$rowIndex]['ownerLastName'],
                        false,
                        LAST_NAME_MAXLEN
                    );
                }
                else
                {
                    $contactsRS[$rowIndex]['ownerAbbrName'] = 'None';
                }

                if (empty($contactsRS[$rowIndex]['phoneWork']))
                {
                    $contactsRS[$rowIndex]['phoneWork'] = 'None';
                }

                if (empty($contactsRS[$rowIndex]['phoneCell']))
                {
                    $contactsRS[$rowIndex]['phoneCell'] = 'None';
                }
            }
        }

        if (!empty($jobOrdersRS))
        {
            foreach ($jobOrdersRS as $rowIndex => $row)
            {
                if ($jobOrdersRS[$rowIndex]['startDate'] == '00-00-00')
                {
                    $jobOrdersRS[$rowIndex]['startDate'] = '';
                }

                if ($jobOrdersRS[$rowIndex]['isHot'] == 1)
                {
                    $jobOrdersRS[$rowIndex]['linkClass'] = 'jobLinkHot';
                }
                else
                {
                    $jobOrdersRS[$rowIndex]['linkClass'] = 'jobLinkCold';
                }

                if (!empty($jobOrdersRS[$rowIndex]['recruiterAbbrName']))
                {
                    $jobOrdersRS[$rowIndex]['recruiterAbbrName'] = StringUtility::makeInitialName(
                        $jobOrdersRS[$rowIndex]['recruiterFirstName'],
                        $jobOrdersRS[$rowIndex]['recruiterLastName'],
                        false,
                        LAST_NAME_MAXLEN
                    );
                }
                else
                {
                    $jobOrdersRS[$rowIndex]['recruiterAbbrName'] = 'None';
                }

                if (!empty($jobOrdersRS[$rowIndex]['ownerFirstName']))
                {
                    $jobOrdersRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName(
                        $jobOrdersRS[$rowIndex]['ownerFirstName'],
                        $jobOrdersRS[$rowIndex]['ownerLastName'],
                        false,
                        LAST_NAME_MAXLEN
                    );
                }
                else
                {
                    $jobOrdersRS[$rowIndex]['ownerAbbrName'] = 'None';
                }
            }
        }

        $this->_template->assign('active', $this);
        $this->_template->assign('jobOrdersRS', $jobOrdersRS);
        $this->_template->assign('candidatesRS', $candidatesRS);
        $this->_template->assign('companiesRS', $companiesRS);
        $this->_template->assign('contactsRS', $contactsRS);
        //$this->_template->assign('listsRS', $listsRS);
        $this->_template->assign('wildCardQuickSearch', $wildCardQuickSearch);

        if (!eval(Hooks::get('HOME_QUICK_SEARCH'))) return;

        $this->_template->display('./modules/home/SearchEverything.php');
    }
Ejemplo n.º 12
0
                <? else: ?>
                    <?php 
echo QuickSearch::get('old_id', new StandardSearch('user_id'))->render();
?>
                <? endif; ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php 
echo _('Neuer zusammengeführter Benutzer:');
?>
                </td>
                <td>
                    <?php 
echo QuickSearch::get('new_id', new StandardSearch('user_id'))->render();
?>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="convert_ident">
                        <?php 
echo _('Identitätsrelevante Daten migrieren:');
?>
                    </label>
                </td>
                <td>
                    <input type="checkbox" name="convert_ident" id="convert_ident" checked>
                    <i>
                        <?php 
Ejemplo n.º 13
0
                <? endforeach;?>
                </select>
            </td>
        </tr>
    <? endif ?>
        <!-- form zur freien Suche -->
        <tr>
            <td>
                <strong><?php 
echo _('Name:');
?>
</strong>
            </td>
            <td>
                <?php 
echo QuickSearch::get('name', $search_object)->setInputStyle('width: 400px')->setAttributes(array('autofocus' => ''))->defaultValue('', $name)->fireJSFunctionOnSelect('STUDIP.Browse.selectUser')->noSelectbox()->render();
?>
            </td>
        </tr>
    </tbody>
    <tfoot>
        <tr>
            <td colspan="2">
                <?php 
echo Button::createAccept(_('Suchen'), 'send');
?>
                <?php 
echo Button::create(_('Zurücksetzen'), 'reset');
?>
            </td>
        </tr>
Ejemplo n.º 14
0
 public function edit_action($range_id = null, $event_id = null)
 {
     $this->range_id = $range_id ?: $this->range_id;
     // get group and the calendars of the members
     // the first calendar is the calendar of the actual user
     $this->calendar = new SingleCalendar($GLOBALS['user']->id);
     $group = $this->getGroup($this->calendar);
     if ($group) {
         $calendar_owners = CalendarUser::getOwners($GLOBALS['user']->id, Calendar::PERMISSION_WRITABLE)->pluck('owner_id');
         $members = $group->members->pluck('user_id');
         $user_id = Request::option('user_id');
         $this->attendee_ids = array_intersect($calendar_owners, $members);
         $this->attendee_ids[] = $GLOBALS['user']->id;
         if ($user_id && in_array($user_id, $this->attendee_ids)) {
             $this->attendee_ids = array($user_id);
         }
     }
     $this->event = $this->calendar->getEvent($event_id);
     if ($this->event->isNew()) {
         $this->event = $this->calendar->getNewEvent();
         if (Request::get('isdayevent')) {
             $this->event->setStart(mktime(0, 0, 0, date('n', $this->atime), date('j', $this->atime), date('Y', $this->atime)));
             $this->event->setEnd(mktime(23, 59, 59, date('n', $this->atime), date('j', $this->atime), date('Y', $this->atime)));
         } else {
             $this->event->setStart($this->atime);
             $this->event->setEnd($this->atime + 3600);
         }
         $this->event->setAuthorId($GLOBALS['user']->id);
         $this->event->setEditorId($GLOBALS['user']->id);
         $this->event->setAccessibility('PRIVATE');
         if ($this->attendee_ids) {
             foreach ($this->attendee_ids as $attendee_id) {
                 $attendee_event = clone $this->event;
                 $attendee_event->range_id = $attendee_id;
                 $this->attendees[] = $attendee_event;
             }
         }
         if (!Request::isXhr()) {
             PageLayout::setTitle($this->getTitle($this->calendar, _('Neuer Termin')));
         }
     } else {
         // open read only events and course events not as form
         // show information in dialog instead
         if (!$this->event->havePermission(Event::PERMISSION_WRITABLE) || $this->event instanceof CourseEvent) {
             $this->redirect($this->url_for('calendar/single/event/' . implode('/', array($this->range_id, $this->event->event_id))));
             return null;
         }
         $this->attendees = $this->event->getAttendees();
         if (!Request::isXhr()) {
             PageLayout::setTitle($this->getTitle($this->calendar, _('Termin bearbeiten')));
         }
     }
     if (get_config('CALENDAR_GROUP_ENABLE') && $this->calendar->getRange() == Calendar::RANGE_USER) {
         $search_obj = new SQLSearch("SELECT auth_user_md5.user_id, {$GLOBALS['_fullname_sql']['full_rev']} as fullname, username, perms " . "FROM calendar_user " . "LEFT JOIN auth_user_md5 ON calendar_user.owner_id = auth_user_md5.user_id " . "LEFT JOIN user_info ON (auth_user_md5.user_id = user_info.user_id) " . 'WHERE calendar_user.user_id = ' . DBManager::get()->quote($GLOBALS['user']->id) . ' AND calendar_user.permission > ' . Event::PERMISSION_READABLE . ' AND (username LIKE :input OR Vorname LIKE :input ' . "OR CONCAT(Vorname,' ',Nachname) LIKE :input " . "OR CONCAT(Nachname,' ',Vorname) LIKE :input " . "OR Nachname LIKE :input OR {$GLOBALS['_fullname_sql']['full_rev']} LIKE :input " . ") ORDER BY fullname ASC", _('Person suchen'), 'user_id');
         $this->quick_search = QuickSearch::get('user_id', $search_obj)->fireJSFunctionOnSelect('STUDIP.Messages.add_adressee');
         //      $default_selected_user = array($this->calendar->getRangeId());
         $this->mps = MultiPersonSearch::get('add_adressees')->setLinkText(_('Mehrere Teilnehmer hinzufügen'))->setTitle(_('Mehrere Teilnehmer hinzufügen'))->setExecuteURL($this->url_for($this->base . 'edit'))->setJSFunctionOnSubmit('STUDIP.Messages.add_adressees')->setSearchObject($search_obj);
         $owners = SimpleORMapCollection::createFromArray(CalendarUser::findByUser_id($this->calendar->getRangeId()))->pluck('owner_id');
         foreach (Calendar::getGroups($GLOBALS['user']->id) as $group) {
             $this->mps->addQuickfilter($group->name, $group->members->filter(function ($member) use($owners) {
                 if (in_array($member->user_id, $owners)) {
                     return $member;
                 }
             })->pluck('user_id'));
         }
     }
     $stored = false;
     if (Request::submitted('store')) {
         $stored = $this->storeEventData($this->event, $this->calendar);
     }
     if ($stored !== false) {
         // switch back to group context
         $this->range_id = $group->getId();
         if ($stored === 0) {
             if (Request::isXhr()) {
                 header('X-Dialog-Close: 1');
                 exit;
             } else {
                 PageLayout::postMessage(MessageBox::success(_('Der Termin wurde nicht geändert.')));
                 $this->relocate('calendar/group/' . $this->last_view, array('atime' => $this->atime));
             }
         } else {
             PageLayout::postMessage(MessageBox::success(_('Der Termin wurde gespeichert.')));
             $this->relocate('calendar/group/' . $this->last_view, array('atime' => $this->atime));
         }
     } else {
         $this->createSidebar('edit', $this->calendar);
         $this->createSidebarFilter();
         $this->render_template('calendar/single/edit', $this->layout);
     }
 }
 /**
  *
  * get the list of matching partners through searching criteria
  * the attributes involved in the searching criteria would be as follows
  * + gender information
  * + age information      (both high range and low range)
  * + religion Information (both religion and sect)
  * + state information    (both country and city)
  *
  * Once all the attributes are satisfied the system will perform the search operation to find the matching
  * partners list.
  * The list of matching partner will contain partner
  * + gender
  * + age
  * + religion (religion & sect)
  * + state    (country & state)
  * + username
  * + approved image -- if the user does not have any image or in case the uploaded image is not approved
  *   then the default image will be shown instead
  *
  * The System will search through series of age constraints which is observed normally during partner
  * searching in real world..
  *
  * @param $gender
  * @param int $ageLow
  * @param int $ageHigh
  * @param $religion
  * @param $sect
  * @param $country
  * @param $city
  * @return array
  */
 public function performQuickSearch($gender, $ageHigh, $ageLow, $religion, $sect, $country, $city)
 {
     $Object = new QuickSearch();
     $result = $Object->getMatchingPartnersList($gender, $ageLow, $ageHigh, $religion, $sect, $country, $city);
     return $result;
 }
Ejemplo n.º 16
0
 /**
  * Provides a dialog to move or copy selected users to another course.
  */
 public function select_course_action()
 {
     if (Request::submitted('submit')) {
         CSRFProtection::verifyUnsafeRequest();
         $this->flash['users_to_send'] = Request::getArray('users');
         $this->flash['target_course'] = Request::option('course_id');
         $this->flash['move'] = Request::int('move');
         $this->redirect('course/members/send_to_course');
     } else {
         global $perm;
         if ($perm->have_perm('root')) {
             $parameters = array('semtypes' => studygroup_sem_types() ?: array(), 'exclude' => array($GLOBALS['SessSemName'][1]));
         } else {
             if ($perm->have_perm('admin')) {
                 $parameters = array('semtypes' => studygroup_sem_types() ?: array(), 'institutes' => array_map(function ($i) {
                     return $i['Institut_id'];
                 }, Institute::getMyInstitutes()), 'exclude' => array($GLOBALS['SessSemName'][1]));
             } else {
                 $parameters = array('userid' => $GLOBALS['user']->id, 'semtypes' => studygroup_sem_types() ?: array(), 'exclude' => array($GLOBALS['SessSemName'][1]));
             }
         }
         $coursesearch = MyCoursesSearch::get('Seminar_id', $GLOBALS['perm']->get_perm(), $parameters);
         $this->search = QuickSearch::get('course_id', $coursesearch)->setInputStyle('width:100%')->withButton()->render();
         $this->course_id = Request::option('course_id');
         $this->course_id_parameter = Request::get('course_id_parameter');
         if (!empty($this->flash['users']) || Request::getArray('users')) {
             $users = $this->flash['users'] ?: Request::getArray('users');
             // create a usable array
             foreach ($this->flash['users'] as $user => $val) {
                 if ($val) {
                     $this->users[] = $user;
                 }
             }
             if (Request::isXhr()) {
                 $this->response->add_header('X-Title', _('Zielveranstaltung auswählen'));
             }
         } else {
             if (Request::isXhr()) {
                 $this->response->add_header('X-Dialog-Close', '1');
                 $this->render_nothing();
             } else {
                 $this->redirect('course/members/index');
             }
         }
     }
 }
Ejemplo n.º 17
0
 /**
  * Fetches available institutes for the current user.
  */
 public function institutes_action()
 {
     CSRFProtection::verifyUnsafeRequest();
     $this->myInstitutes = Institute::getMyInstitutes();
     $this->selectedInstitutes = array();
     foreach (Request::getArray('institutes') as $institute) {
         $this->selectedInstitutes[$institute] = new Institute($institute);
     }
     Config::get()->AJAX_AUTOCOMPLETE_DISABLED = false;
     $this->instSearch = QuickSearch::get("institute_id", new StandardSearch("Institut_id"))->withOutButton()->render();
 }
Ejemplo n.º 18
0
Archivo: new.php Proyecto: ratbird/hope
                           value="<?php 
echo htmlReady($this->flash['request']['target']);
?>
"
                           style="width: 240px;" maxlen="254">

                    <?php 
echo QuickSearch::get('seminar', new StandardSearch('Seminar_id'))->setInputStyle('width: 240px')->setInputClass('target-seminar')->render();
?>

                    <?php 
echo QuickSearch::get('institut', new StandardSearch('Institut_id'))->setInputStyle('width: 240px')->setInputClass('target-inst')->render();
?>

                    <?php 
echo QuickSearch::get('user', new StandardSearch('username'))->setInputStyle('width: 240px')->setInputClass('target-user')->render();
?>

                    <span class="target-none"><?php 
echo _('Kein Verweisziel');
?>
</span>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="start_day"><?php 
echo _('Anzeigen ab:');
?>
</label>
                </td>
Ejemplo n.º 19
0
 function print_qs()
 {
     // add skip link
     SkipLinks::addIndex(_("Suchformular"), 'search_sem_qs', 100);
     // add a skip link for advanced search here
     //   SkipLinks::addLink(_("Erweiterte Suche"), URLHelper::getLink('dispatch.php/search/courses', array('cmd' => 'xts', 'level' => 'f')), 120);
     //Quicksort Formular... fuer die eiligen oder die DAUs....
     echo $this->search_obj->getFormStart(URLHelper::getLink());
     echo "<table id=\"search_sem_qs\" border=\"0\" align=\"center\" cellspacing=0 cellpadding=2 width = \"99%\">\n";
     echo "<tr><td class=\"table_row_even\" align=\"center\" valign=\"middle\"><font size=\"-1\">";
     echo '<label for="search_sem_qs_choose">' . _("Schnellsuche:") . "</label>&nbsp;";
     echo $this->search_obj->getSearchField("qs_choose", array('style' => 'vertical-align:middle;font-size:9pt;', 'id' => 'search_sem_qs_choose'));
     if ($this->sem_browse_data['level'] == "vv") {
         $this->search_obj->sem_tree =& $this->sem_tree->tree;
         if ($this->sem_tree->start_item_id != 'root') {
             $this->search_obj->search_scopes[] = $this->sem_tree->start_item_id;
         }
         echo "&nbsp;<label for=\"search_sem_scope_choose\">" . _("in:") . "</label>&nbsp;" . $this->search_obj->getSearchField("scope_choose", array('style' => 'vertical-align:middle;font-size:9pt;', 'id' => 'search_sem_scope_choose'), $this->sem_tree->start_item_id);
         echo "\n<input type=\"hidden\" name=\"level\" value=\"vv\">";
     }
     if ($this->sem_browse_data['level'] == "ev") {
         $this->search_obj->range_tree =& $this->range_tree->tree;
         if ($this->range_tree->start_item_id != 'root') {
             $this->search_obj->search_ranges[] = $this->range_tree->start_item_id;
         }
         echo "&nbsp;<label for=\"search_sem_range_choose\">" . _("in:") . "</label>&nbsp;" . $this->search_obj->getSearchField("range_choose", array('style' => 'vertical-align:middle;font-size:9pt;', 'id' => 'search_sem_range_choose'), $this->range_tree->start_item_id);
         echo "\n<input type=\"hidden\" name=\"level\" value=\"ev\">";
     }
     echo "&nbsp;<label for=\"search_sem_sem\">" . _("Semester:") . "</label>&nbsp;";
     echo $this->search_obj->getSearchField("sem", array('style' => 'vertical-align:middle;font-size:9pt;', 'id' => 'search_sem_sem'), $this->sem_browse_data['default_sem']);
     echo "&nbsp;";
     echo $this->search_obj->getSemChangeButton(array('style' => 'vertical-align:middle'));
     echo "</font></td></tr><tr><td class=\"table_row_even\" align=\"center\" valign=\"middle\">";
     $quicksearch = QuickSearch::get($this->search_obj->form_name . "_quick_search", new SeminarSearch('number-name-lecturer'))->setAttributes(array('aria-label' => _("Suchbegriff")))->setInputStyle("vertical-align:middle;font-size:9pt;width:50%;")->fireJSFunctionOnSelect("selectSem")->noSelectbox()->defaultValue($this->sem_browse_data['sset'] && strlen($this->sem_browse_data['sset']) ? $this->sem_browse_data['sset'] : '', $this->sem_browse_data['sset'] && strlen($this->sem_browse_data['sset']) ? $this->sem_browse_data['sset'] : '');
     echo $quicksearch->render();
     echo "&nbsp;";
     echo $this->search_obj->getSearchButton(array('style' => 'vertical-align:middle', 'class' => "quicksearchbutton"), true);
     echo \Studip\LinkButton::create(_('Zurücksetzen'), URLHelper::getURL('?reset_all=1'), array('title' => _("Zurücksetzen")));
     echo "</td></tr>";
     echo $this->search_obj->getFormEnd();
     echo "</table>\n";
     echo '<script type="text/javascript">jQuery(function () { jQuery("#' . $quicksearch->getId() . '").focus(); });</script>' . chr(10);
 }
Ejemplo n.º 20
0
                    <a class="toggler">
                        <?php 
echo sprintf(_('%s in die Veranstaltung hinzufügen'), htmlReady($decoratedStatusGroups['autor']));
?>
                    </a>
                </th>
            </tr>
            <tr>
                <td style="width: 30%; text-align: left">
                    <?php 
echo sprintf(_('<strong>%s</strong> in die Veranstaltung eintragen'), htmlReady($decoratedStatusGroups['autor']));
?>
                </td>
                <td style="width: 30%; text-align: left">
                    <?php 
echo QuickSearch::get("new_autor", $search)->withButton(array('reset_button_name' => 'reset_autor', 'search_button_name' => 'search_autor'))->render();
?>
                    <input type="hidden" name="cid" value="<?php 
echo $course_id;
?>
">
                </td>
                <td style="width: 20%; text-align: center">
                    
                </td>
                <td style="width: 20%; text-align: right">
                    <?php 
echo Button::createAccept(_('Eintragen'), 'add_autor', array('title' => sprintf(_("als %s eintragen"), $decoratedStatusGroups['autor'])));
?>
                </td>
            </tr>
Ejemplo n.º 21
0
 function assign_role_institutes_action($role_id, $user_id)
 {
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->set_content_type('text/html;charset=windows-1252');
         $this->response->add_header('X-No-Buttons', 1);
         $this->response->add_header('X-Title', PageLayout::getTitle());
         foreach (array_keys($_POST) as $param) {
             Request::set($param, studip_utf8decode(Request::get($param)));
         }
     }
     if (Request::submitted('add_institute') && ($institut_id = Request::option('institute_id'))) {
         $roles = RolePersistence::getAllRoles();
         $role = $roles[$role_id];
         $user = new StudIPUser($user_id);
         RolePersistence::assignRole($user, $role, Request::option('institute_id'));
         PageLayout::postMessage(MessageBox::success(_("Die Einrichtung wurde zugewiesen.")));
     }
     if ($remove_institut_id = Request::option('remove_institute')) {
         $roles = RolePersistence::getAllRoles();
         $role = $roles[$role_id];
         $user = new StudIPUser($user_id);
         RolePersistence::deleteRoleAssignment($user, $role, $remove_institut_id);
         PageLayout::postMessage(MessageBox::success(_("Die Einrichtung wurde entfernt.")));
     }
     $roles = RolePersistence::getAllRoles();
     $this->role = $roles[$role_id];
     $this->user = new User($user_id);
     $this->institutes = SimpleCollection::createFromArray(Institute::findMany(RolePersistence::getAssignedRoleInstitutes($user_id, $role_id)));
     $this->institutes->orderBy('name');
     $this->qsearch = QuickSearch::get("institute_id", new StandardSearch("Institut_id"));
     if (Request::isXhr()) {
         $this->qsearch->withoutButton();
     }
 }
Ejemplo n.º 22
0
 /**
  * Renders the widget.
  *
  * @param Array $variables Unused variables parameter
  * @return String containing the html output of the widget
  */
 public function render($variables = array())
 {
     $query = parse_url($this->url, PHP_URL_QUERY);
     if ($query) {
         $this->url = str_replace('?' . $query, '', $this->url);
         parse_str(html_entity_decode($query) ?: '', $query_params);
     } else {
         $query_params = array();
     }
     $this->template_variables['url'] = URLHelper::getLink($this->url);
     $this->template_variables['url_params'] = $query_params;
     $this->template_variables['method'] = $this->method;
     $this->template_variables['id'] = $this->id;
     foreach ($this->needles as $index => $needle) {
         if ($needle['quick_search']) {
             $quick_search = QuickSearch::get($needle['name'], $needle['quick_search']);
             if ($needle['js_func'] !== null) {
                 $quick_search->fireJSFunctionOnSelect($needle['js_func']);
             }
             $needle['quick_search'] = $quick_search;
             $this->needles[$index] = $needle;
         }
     }
     if ($this->hasData()) {
         $reset_link = sprintf('<a href="%s">%s %s</a>', URLHelper::getLink($this->template_variables['url'], array('reset-search' => 1)), Icon::create('search+decline', 'clickable')->asImg(["class" => 'text-top']), _('Zurücksetzen'));
         $this->template_variables['reset_search'] = $reset_link;
     }
     $this->template_variables['needles'] = $this->needles;
     $this->template_variables['filters'] = $this->filters;
     $this->template_variables['has_data'] = $this->hasData();
     return parent::render($variables);
 }
Ejemplo n.º 23
0
echo _("Mitgliedschaft ist verboten");
?>
    </label>
</div>

<label class="caption">
    <?php 
echo _('Veranstaltung suchen');
?>
:
</label>

<div style="display:inline-block">

<?php 
echo QuickSearch::get("mandatory_course_id", new SeminarSearch('number-name-lecturer'))->render();
echo SemesterData::GetSemesterSelector(array('name' => 'search_sem_sem'), SemesterData::GetSemesterIndexById($_SESSION['_default_sem']), 'key', false);
?>

</div>

<br><br>
<script>
    $('#ruleform input[name="modus"]').on('change',
        function () {
            var message = [
                "<?php 
echo jsReady($rule->default_message, 'script-double');
?>
",
                "<?php