Пример #1
0
function AJconfirmDeleteRequestProduction($request)
{
    $cdata = array('requestid' => $request['id']);
    $text = '';
    $title = "<big><b>" . i("End Reservation/Make Production") . "</b></big><br><br>";
    $text .= i("Are you satisfied that this environment is ready to be made production and replace the current production version, or would you just like to end this reservation and test it again later?");
    if (isImageBlockTimeActive($request['reservations'][0]['imageid'])) {
        $text .= "<br><font color=\"red\">\n";
        $text .= i("WARNING: This environment is part of an active block allocation. Changing the production version of the environment at this time will result in new reservations under the block allocation to have full reload times instead of a &lt; 1 minutes wait. You can change the production version later by going to Manage Images-&gt;Edit Image Profiles and clicking Edit for this environment.");
        $text .= "</font><br>";
    }
    $cont = addContinuationsEntry('AJsetImageProduction', $cdata, SECINDAY, 0, 1);
    $radios = '';
    $radios .= "<br>&nbsp;&nbsp;&nbsp;<INPUT type=radio name=continuation ";
    $radios .= "value=\"{$cont}\" id=\"radioprod\"><label for=\"radioprod\">";
    $radios .= i("Make this the production version") . "</label><br>";
    $cont = addContinuationsEntry('AJsubmitDeleteRequest', $cdata, SECINDAY, 0, 0);
    $radios .= "&nbsp;&nbsp;&nbsp;<INPUT type=radio name=continuation ";
    $radios .= "value=\"{$cont}\" id=\"radioend\"><label for=\"radioend\">";
    $radios .= i("Just end the reservation") . "</label><br><br>";
    $text = preg_replace("/(.{1,60}([ \n]|\$))/", '\\1<br>', $text);
    $data = array('content' => $title . $text . $radios, 'cont' => $cont, 'btntxt' => i('Submit'));
    sendJSON($data);
}
Пример #2
0
 function getRevisionHTML($imageid)
 {
     $revisions = getImageRevisions($imageid);
     $rt = '';
     $rt .= "<h3>" . i("Revisions of this Image") . "</h3>\n";
     $rt .= "<table summary=\"\"><tr><td>\n";
     if (count($revisions) > 1 && isImageBlockTimeActive($imageid)) {
         $rt .= "<font color=\"red\">";
         $warn = i("WARNING: This image is part of an active block allocation. Changing the production revision of the image at this time will result in new reservations under the block allocation to have full reload times instead of a &lt; 1 minutes wait.");
         $rt .= preg_replace("/(.{1,100}([ \n]|\$))/", '\\1<br>', $warn);
         $rt .= "</font><br>\n";
     }
     $rt .= "<table summary=\"\" id=\"revisiontable\">\n";
     $rt .= "  <tr>\n";
     $rt .= "    <td></td>\n";
     $rt .= "    <th>" . i("Revision") . "</th>\n";
     $rt .= "    <th>" . i("Creator") . "</th>\n";
     $rt .= "    <th>" . i("Created") . "</th>\n";
     $rt .= "    <th nowrap>" . i("In Production") . "</th>\n";
     $rt .= "    <th>" . i("Comments (click to edit)") . "</th>\n";
     $rt .= "  </tr>\n";
     foreach ($revisions as $rev) {
         if ($rev['deleted'] == 1) {
             continue;
         }
         $rt .= "  <tr>\n";
         $rt .= "    <td><INPUT type=checkbox\n";
         $rt .= "              id=chkrev{$rev['id']}\n";
         $rt .= "              name=chkrev[{$rev['id']}]\n";
         $rt .= "              value=1></td>\n";
         $rt .= "    <td align=center>{$rev['revision']}</td>\n";
         $rt .= "    <td>{$rev['creator']}</td>\n";
         $created = date('g:ia n/j/Y', datetimeToUnix($rev['datecreated']));
         $rt .= "    <td>{$created}</td>\n";
         $cdata = $this->basecdata;
         $cdata['imageid'] = $imageid;
         $cdata['revisionid'] = $rev['id'];
         $cont = addContinuationsEntry('AJupdateRevisionProduction', $cdata);
         $rt .= "    <td align=center><INPUT type=radio\n";
         $rt .= "           name=production\n";
         $rt .= "           value={$rev['id']}\n";
         $rt .= "           id=radrev{$rev['id']}\n";
         $rt .= "           onclick=\"updateRevisionProduction('{$cont}');\"\n";
         if ($rev['production']) {
             $rt .= "           checked\n";
         }
         $rt .= "           ></td>\n";
         $cont = addContinuationsEntry('AJupdateRevisionComments', $cdata);
         $rt .= "    <td width=200px><span id=comments{$rev['id']} \n";
         $rt .= "              dojoType=\"dijit.InlineEditBox\"\n";
         $rt .= "              editor=\"dijit.form.Textarea\"\n";
         $rt .= "              onChange=\"updateRevisionComments('comments{$rev['id']}', '{$cont}');\"\n";
         $rt .= "              noValueIndicator=\"(empty)\">\n";
         $rt .= "        {$rev['comments']}</span></td>\n";
         $rt .= "  </tr>\n";
     }
     $rt .= "</table>\n";
     $rt .= "<div align=left>\n";
     $keys = array_keys($revisions);
     $cdata = $this->basecdata;
     $cdata['revids'] = $keys;
     $cdata['imageid'] = $imageid;
     $cont = addContinuationsEntry('AJdeleteRevisions', $cdata);
     $ids = implode(',', $keys);
     $rt .= "<button onclick=\"deleteRevisions('{$cont}', '{$ids}'); return false;\">";
     $rt .= i("Delete selected revisions") . "</button>\n";
     $rt .= "</div>\n";
     $rt .= "</td></tr></table>\n";
     return $rt;
 }