Esempio n. 1
0
$page->addHtml($selected . ' value="0">' . $gL10n->get('LST_CREATE_NEW_CONFIGURATION') . '</option>');
// alle relevanten Konfigurationen fuer den User suchen
$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) {
Esempio n. 2
0
 /**
  * @param bool $updateFingerPrint
  */
 public function save($updateFingerPrint = true)
 {
     $this->db->startTransaction();
     parent::save($updateFingerPrint);
     // save columns
     foreach ($this->columns as $number => $listColumn) {
         if ($listColumn->getValue('lsc_lst_id') == 0) {
             $listColumn->setValue('lsc_lst_id', $this->getValue('lst_id'));
         }
         $listColumn->save($updateFingerPrint);
     }
     $this->db->endTransaction();
 }
Esempio n. 3
0
 public function save($updateFingerPrint = true)
 {
     $this->db->startTransaction();
     parent::save($updateFingerPrint);
     // jetzt noch die einzelnen Spalten sichern
     foreach ($this->columns as $number => $listColumn) {
         if ($listColumn->getValue('lsc_lst_id') == 0) {
             $listColumn->setValue('lsc_lst_id', $this->getValue('lst_id'));
         }
         $listColumn->save($updateFingerPrint);
     }
     $this->db->endTransaction();
 }