diff --git a/config/lang/de.json b/config/lang/de.json index 00b480f1f11d1c5be2b330a449f0bfcad1e3cfd6..b0f51b14aadde0e737e5e59ed4224a4d1adbac36 100644 --- a/config/lang/de.json +++ b/config/lang/de.json @@ -270,6 +270,7 @@ "projectmanager": "Projektleiter", "queue": "Queue", "replacement-fields": "erkannte Platzhalter:", + "replacement-fields-not-found": "Es wurden keine Platzhalter im Format <em>@replace["Name"]</em> im Template gefunden.", "replacement-targetfile": "Ziel-Datei", "replacements": "Ersetzungen mit Template-Dateien", "replacements-info": "Beim Build-Prozess gefundene Templates werden aufgelistet und darin erkannte Platzhalter erkannt. Die Felder sind ausschliesslich für die neue Infrastruktur relevant.", diff --git a/config/lang/en.json b/config/lang/en.json index fd290eec339abd8fd0d9a9061a64c293522067b6..a2b3edcfc4aa6962997c125320bc73c041ce532e 100644 --- a/config/lang/en.json +++ b/config/lang/en.json @@ -272,6 +272,7 @@ "projectmanager": "Projekt manager", "queue": "Queue", "replacement-fields": "Detected placeholders:", + "replacement-fields-not-found": "No placeholder in the syntax <em>@replace["name"]</em> were found in the template.", "replacement-targetfile": "Target file", "replacements": "Replacements in template files", "replacements-info": "List of detected templates with its placeholders.", diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index ddeb0acc3f5894d0a6fa93010e7eddb4fe513359..27c71de7e1c597b801be379c359d8372dfe32494 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -644,7 +644,7 @@ class project extends base { // keep a few $iKeep = $bDeleteAll ? 0 : $this->_aConfig["versionsToKeep"]; - while (count($aUnused) && count($aUnused) >= $iKeep) { + while (count($aUnused) && count($aUnused) > $iKeep) { $sVersion = array_shift($aUnused); $sDir2 = $sDir . '/' . $sVersion; if (is_dir($sDir2)){ @@ -3334,20 +3334,27 @@ class project extends base { $aForms["setup"]["form"]['input' . $i++] = array( 'type' => 'markup', 'value' => '<br>'.t("replacement-fields") - // . '<pre>'.print_r($aValues, 1).'</pre>' ); - foreach ($aFields as $sField){ - + if(count($aFields)){ + foreach ($aFields as $sField){ + + $aForms["setup"]["form"]['input' . $i++] = array( + 'type' => 'text', + 'disabled' => $this->oUser->hasPermission("project-action-setup-edit-replacements") ? '' : 'disabled', + 'name' => 'phases[' . $sPhase . '][replace]['.$tTplFile.']['.$sField.']', + 'label' => $sField, + 'value' => $aValues && array_key_exists($sField, $aValues) ? $aValues[$sField] : '', + // 'required' => 'required', + 'validate' => 'isastring', + 'size' => 100, + 'placeholder' => $sField, + ); + } + } else { $aForms["setup"]["form"]['input' . $i++] = array( - 'type' => 'text', - 'disabled' => $this->oUser->hasPermission("project-action-setup-edit-replacements") ? '' : 'disabled', - 'name' => 'phases[' . $sPhase . '][replace]['.$tTplFile.']['.$sField.']', - 'label' => $sField, - 'value' => $aValues && array_key_exists($sField, $aValues) ? $aValues[$sField] : '', - // 'required' => 'required', - 'validate' => 'isastring', - 'size' => 100, - 'placeholder' => $sField, + 'type' => 'markup', + 'value' => '<br>'.$this->getBox("error", t("replacement-fields-not-found")) + // . '<pre>'.print_r($aValues, 1).'</pre>' ); } }