view: Viewing information and version history of a procdef

Previous: delete: Deleting unnecessary versions ] [ Top: The procdef manager ] [ Next: checkout: Creating a new version ]

The view command serves as a jumping-off point for working with a procdef. It displays the various versions defined over the history of the procdef, and allows you to check the procdef out (creating a new version.) I guess it's logical that you should also be able to check versions in from this screen, but we'll see if that makes sense.
 
See Loading an item file

printf ("Content-type: text/html\n\n");
printf ("<html><head><title>Procdef %s</title></head>\n", xml_attrval (item, "title"));
printf ("<body bgcolor=ffffff>\n");
printf ("<h2>Procdef -- '%s'</h2>Current version: %s<br>Original author: %s<hr>",
        xml_attrval (item, "title"),
        *(xml_attrval (item, "ver")) ? xml_attrval (item, "ver") : "<b>none</b>",
        xml_attrval (item, "owner"));

holder = xml_loc (item, "item.description");
if (holder) {
   xml_writecontent (stdout, holder);
   printf ("<p>\n");
}

printf ("<ul>\n");
xml = xml_loc (item, "item.versions");
if (xml) {
   holder = xml_firstelem (xml);
   while (holder) {
      if (!strcmp (holder->name, "version")) {
         printf ("<li> <a href=%s?command=edit&item=%s&ver=%s>Version %s</a>\n",
                 xml_attrval (environment, "SCRIPT_NAME"), xml_attrval (query, "item"),
                 xml_attrval (holder, "id"), xml_attrval (holder, "id"));
         if (!strcmp (xml_attrval (holder, "id"), xml_attrval (item, "ver"))) {
            printf (" (current)\n");
         }
      }
      holder = xml_nextelem (holder);
   }
}
printf ("</ul>\n");

if (user_perm (current_user, "workflow", xml_attrval (query, "item"), "checkout")) {
   printf ("<form action=\"%s\" method=GET>\n", xml_attrval (environment, "SCRIPT_NAME"));
   printf ("<input type=hidden name=command value=checkout>\n");
   printf ("<input type=hidden name=item value=%s>\n", xml_attrval (query, "item"));
   printf ("<input type=submit value=\"Check out a new version\">\n");
   printf ("</form>\n");
}

printf ("</body></html>\n");
Previous: delete: Deleting unnecessary versions ] [ Top: lpml alpha ] [ Next: checkout: Creating a new version ]


This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2000, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license.