/**
  * repository::_repair_dependency()
  *
  * repair repository dependency
  *
  */
 function _repair_dependency(&$entry, $order)
 {
     list($type, $rid, $uid) = explode(":", $entry['repository_id']);
     if (!empty($type) && empty($order)) {
         $order = $type;
     } elseif (empty($type) && !empty($order)) {
         $type = $order;
     }
     if (empty($order)) {
         return false;
     }
     $_modrepid = $type . ':' . $rid;
     $_parent_found = false;
     if ($this->_auto_repair && $entry['repository_id'] != '') {
         if (is_array($parent = $this->_data(0, $type, $_modrepid, true))) {
             foreach ($parent as $modul) {
                 if (lib_floatval($entry['version']) >= lib_floatval($modul['version']) && empty($modul['source_id']) && $modul['id' . $type] != $entry['id' . $type]) {
                     $entry['source_id'] = $modul['id' . $type];
                     $entry['scounto'] = 1;
                     $sql = "UPDATE " . $this->_db_var[$type] . " SET source_id = '" . $entry['source_id'] . "' WHERE repository_id = '" . $entry['repository_id'] . "'";
                     $_parent_found = true;
                     break;
                 }
             }
         } elseif (is_array($parent = $this->_data($entry['idclient'], $type, $_modrepid, true))) {
             foreach ($parent as $modul) {
                 if (lib_floatval($entry['version']) >= lib_floatval($modul['version']) && empty($modul['source_id']) && $modul['id' . $type] != $entry['id' . $type]) {
                     $entry['source_id'] = $modul['id' . $type];
                     $entry['scount'] = 1;
                     $sql = "UPDATE " . $this->_db_var[$type] . " SET source_id = '" . $entry['source_id'] . "' WHERE repository_id = '" . $entry['repository_id'] . "'";
                     $_parent_found = true;
                     break;
                 }
             }
         } else {
             if ($this->_repair_repid($entry, $order)) {
                 return $this->_repair_dependency($entry, $order);
             }
         }
     }
     if (!$_parent_found) {
         $entry['source_id'] = 0;
         $sql = "UPDATE " . $this->_db_var[$type] . " SET source_id = '" . $entry['source_id'] . "' WHERE id" . $order . " = '" . $entry['id' . $order] . "'";
     }
     if (!($update = $this->_db->query($sql))) {
         return false;
     } else {
         return true;
     }
 }
Esempio n. 2
0
            }
        }
    } elseif ($idclient == '0' && count($items['rep']["{$repid}"]) >= 1) {
        foreach ($items['rep']["{$repid}"] as $modul) {
            if (lib_floatval($modversion) > lib_floatval($modul['version']) && $modul['idclient'] == '0') {
                $umod[] = $modul;
            } elseif (lib_floatval($modversion) == lib_floatval($modul['version']) && $modul['idclient'] == '0') {
                $rmod[] = $modul;
            }
        }
    }
} else {
    $modul = $rep->mod_data($idmod, $idclient);
    if (lib_floatval($updatedata['version']) > lib_floatval($modul['version']) && !empty($modul['source_id'])) {
        $umod[] = $modul;
    } elseif (lib_floatval($updatedata['version']) == lib_floatval($modul['version']) && !empty($modul['source_id'])) {
        $rmod[] = $modul;
    }
}
$modversion = $updatedata['version'];
$modname = $updatedata['name'];
$tmp['ENTRY_BGCOLOR'] = '#DBE3EF';
$tmp['OVERENTRY_BGCOLOR'] = '#C7D5EB';
$ENTRY_SAFE = $cms_lang['mod_confirm_new'] . ' <input type="checkbox" name="smodule[' . $sourceid . ']" value="true" id="smodule[' . $sourceid . ']" /> ';
// Start Output
echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n";
echo "    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"de\" lang=\"de\">\n";
echo "<head>\n";
echo "  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n";
Esempio n. 3
0
$tmp['OVERENTRY_BGCOLOR'] = '#C7D5EB';
// read Repository
$items = $rep->rep_local_count($idclient, 'mod');
if ($idclient != '0' && count($items['rep']["{$idclient}"]["{$repid}"]) >= 1) {
    foreach ($items['rep']["{$idclient}"]["{$repid}"] as $modul) {
        if (lib_floatval($modversion) > lib_floatval($modul['version'])) {
            $umod[] = $modul;
        } elseif (lib_floatval($modversion) == lib_floatval($modul['version'])) {
            $rmod[] = $modul;
        }
    }
} elseif ($idclient == '0' && count($items['rep']["{$repid}"]) >= 1) {
    foreach ($items['rep']["{$repid}"] as $modul) {
        if (lib_floatval($modversion) > lib_floatval($modul['version']) && $modul['idclient'] == '0') {
            $umod[] = $modul;
        } elseif (lib_floatval($modversion) == lib_floatval($modul['version']) && $modul['idclient'] == '0') {
            $rmod[] = $modul;
        }
    }
}
$ENTRY_SAFE = '<label for="smodule[' . $s_upload['modrepid'] . ']">' . $cms_lang['mod_confirm_new'] . '</label> <input type="checkbox" name="smodule[' . $s_upload['modrepid'] . ']" value="true" id="smodule[' . $s_upload['modrepid'] . ']" /> ';
// Start Output
echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n";
echo "    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"de\" lang=\"de\">\n";
echo "<head>\n";
echo "  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n";
echo '  <title>Sefrengo ' . $cfg_cms['version'] . '</title>';
echo "\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"tpl/standard/css/styles.css\" />\n";
echo "  <script src=\"tpl/standard/js/init.sefrengo.js\" type=\"text/javascript\"></script>\n";