Example #1
0
 public function clear()
 {
     $this->columns = array();
     parent::clear();
 }
Example #2
0
$sql = 'SELECT * FROM ' . TBL_LISTS . '
                         WHERE lst_org_id = ' . $gCurrentOrganization->getValue('org_id') . '
                           AND (  lst_usr_id = ' . $gCurrentUser->getValue('usr_id') . '
                               OR lst_global = 1)
                         ORDER BY lst_global ASC, lst_name ASC, lst_timestamp DESC ';
$lst_result = $gDb->query($sql);
if ($gDb->num_rows() > 0) {
    $list_global_flag = '';
    $list_name_flag = '';
    $optgroup_flag = 0;
    $counterUnsavedLists = 0;
    $tableListGlobalFlag = null;
    $tableListNameFlag = null;
    $tableList = new TableLists($gDb);
    while ($row = $gDb->fetch_array($lst_result)) {
        $tableList->clear();
        $tableList->setArray($row);
        // maximal nur die letzten 5 Konfigurationen ohne Namen speichern
        if (strlen($tableList->getValue('lst_name')) == 0) {
            $counterUnsavedLists++;
        }
        if ($counterUnsavedLists > 5 && strlen($tableList->getValue('lst_name')) == 0) {
            // alle weiteren Konfigurationen ohne Namen loeschen
            $del_list = new ListConfiguration($gDb, $tableList->getValue('lst_id'));
            $del_list->delete();
        } else {
            // erst mal schauen, ob eine neue Gruppe von Konfigurationen angefangen hat
            if ($tableList->getValue('lst_global') != $tableListGlobalFlag || $tableList->getValue('lst_name') != $tableListNameFlag && strlen($tableListNameFlag) == 0) {
                if ($optgroup_flag == 1) {
                    $page->addHtml('</optgroup>');
                }