0.12_16 commit r0_12_16
authorTony Cook <tony@develop-help.com>
Thu, 12 Sep 2002 03:39:10 +0000 (03:39 +0000)
committertony <tony@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Thu, 12 Sep 2002 03:39:10 +0000 (03:39 +0000)
Makefile
site/cgi-bin/modules/BSE/Util/Tags.pm
site/docs/bse.pod
site/templates/admin/article_img.tmpl
site/templates/admin/edit_0.tmpl
site/templates/admin/edit_1.tmpl
site/templates/admin/edit_2.tmpl
site/templates/admin/edit_catalog.tmpl
site/templates/admin/edit_product.tmpl
site/templates/admin/filelist.tmpl

index ffe842c..8186fcb 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.12_15
+VERSION=0.12_16
 DISTNAME=bse-$(VERSION)
 DISTBUILD=$(DISTNAME)
 DISTTAR=../$(DISTNAME).tar
index ff198d2..210db14 100644 (file)
@@ -360,32 +360,31 @@ sub tag_if_user_can {
       }
       if ($artname =~ /^(-1|\d+)$/) {
        if ($artname == -1) {
-         $article = \%dummy_site_article;
+         $article = -1;
        }
        else {
-         require Articles;
-         $article = Articles->getByPkey($artname);
-         unless ($article) {
-           print STDERR "Could not find article $artname\n";
-           return;
-         }
+         $article = $artname;
        }
       }
       elsif ($artname =~ /^\w+$/) {
        $article = $req->get_object($artname);
        unless ($article) {
          if (my $artid = $req->cfg->entry('articles', $artname)) {
-           if ($artid == -1) {
-             $article = \%dummy_site_article;
-           }
-           else {
-             require Articles;
-             $article = Articles->getByPkey($artid);
-           }
-           unless ($article) {
-             print STDERR "Could not find article id $artid (from $artname)\n";
-             return;
-           }
+           $article = $artid;
+#          if ($artid == -1) {
+#            $article = \%dummy_site_article;
+#          }
+#          else {
+#            require Articles;
+#            $article = Articles->getByPkey($artid);
+#          }
+#          unless ($article) {
+#            print STDERR "Could not find article id $artid (from $artname)\n";
+#            return;
+#          }
+         }
+         elsif ($acts->{$artname}) {
+           $article = $templater->perform($acts, $artname, 'id');
          }
          else {
            print STDERR "Unknown article name $artname\n";
index 201c306..610a2a3 100644 (file)
@@ -10,6 +10,22 @@ Maybe I'll add some other bits here.
 
 =head1 CHANGES
 
+=head2 0.12_16
+
+=over
+
+=item *
+
+the ifUserCan tag wasn't converting article names into numbers
+correctly
+
+=item *
+
+a few pages didn't supply the article parameter to ifUserCan correctly
+(or at all in some cases)
+
+=back
+
 =head2 0.12_15
 
 =over
index 985e2e2..ef2c7f5 100644 (file)
@@ -12,7 +12,7 @@
 <:ifMessage:> 
 <p><b><:message:> </b></p>
 <:or:><:eif:>
-<:if UserCan edit_images_add:>
+<:if UserCan edit_images_add:article:>
 <h2>Add new image</h2>
 
 <form method="POST" action="<:script:>" enctype="multipart/form-data">
           </tr>
           <tr bgcolor="#FFFFFF"> 
             <td valign="top"> 
-              <:ifUserCan edit_images_save article:><input type="text" name="alt" value="<: image alt :>" size="32"><:or:><: image alt :><:eif:>
+              <:ifUserCan edit_images_save:article:><input type="text" name="alt" value="<: image alt :>" size="32"><:or:><: image alt :><:eif:>
             </td>
             <td valign="top" width="50%"> 
-              <:ifUserCan edit_images_save article:><input type="text" name="url" value="<: image url :>" size="32"><:or:><: image url :><:eif:>
+              <:ifUserCan edit_images_save:article:><input type="text" name="url" value="<: image url :>" size="32"><:or:><: image url :><:eif:>
             </td>
             <td valign="bottom" nowrap> 
-              <:ifUserCan edit_images_delete article:><b><a href="<:script:>?level=<: level :>&parentid=<: article parentid :>&id=<:article id:>&imgtype=<: articleType :>&removeimg_<: image id :>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b><:or:><:eif:>
+              <:ifUserCan edit_images_delete:article:><b><a href="<:script:>?level=<: level :>&parentid=<: article parentid :>&id=<:article id:>&imgtype=<: articleType :>&removeimg_<: image id :>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b><:or:><:eif:>
 <:imgmove:> </td>
           </tr>
           <: iterator separator images :> 
             <td colspan="3">&nbsp;</td>
           </tr>
           <: iterator end images :> 
-<:ifUserCan edit_images_save article:>
+<:ifUserCan edit_images_save:article:>
           <tr> 
             <td align="right" bgcolor="#FFFFFF" colspan="3"> 
               <input type="submit" name="process" value="Save changes">
index 4bdc36a..4cf5b83 100644 (file)
@@ -73,7 +73,7 @@
           <td width="70%"><: summary child body :></td>
           <td bgcolor="#FFFFFF" align="center"><: is child listed :></td>
           <td nowrap> <a href="/cgi-bin/admin/add.pl?id=<:child id:>">Edit</a> 
-            <:if UserCan edit_delete_article child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this Section')">Delete</a> <:or UserCan:><:eif UserCan:>
+            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this Section')">Delete</a> <:or UserCan:><:eif UserCan:>
             <:movechild:> </td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
index 3ff5fd4..c2463da 100644 (file)
   <p><: ifnew :>
     <input type="submit" name="save" value="  Add New <: articleType:>  ">
    <:or:>
-  <:if UserCan edit_save article:><input type="submit" name="save" value="  Update <: articleType:>  "><:or UserCan:><:eif UserCan:>
+  <:if UserCan edit_save:article:><input type="submit" name="save" value="  Update <: articleType:>  "><:or UserCan:><:eif UserCan:>
    <:eif:></p>
   </form>
 <:if children:> <:ifEq [article id] 3:> 
           <th>Listed</th>
           <th nowrap>Modify</th>
         </tr>
-<:if UserCan edit_reorder_children:>
+<:if UserCan edit_reorder_children:article:>
         <tr> 
           <td colspan="4" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
           <td width="70%"><: summary child body :></td>
           <td align="center"><: is child listed :></td>
           <td nowrap> <a href="/cgi-bin/admin/add.pl?id=<:child id:>">Edit</a> 
-            <:if UserCan edit_delete_article child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
+            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
             <:movechild:> </td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
 <:if HaveChildType:>
 <:if new:>
 <:or new:>
-<:if UserCan edit_add_child article:><form action="/cgi-bin/admin/add.pl">
+<:if UserCan edit_add_child:article:><form action="/cgi-bin/admin/add.pl">
 <input type=hidden name="parentid" value="<:article id:>">
   <p> 
     <input type=submit value="Add <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>">
index 3ff5fd4..c2463da 100644 (file)
   <p><: ifnew :>
     <input type="submit" name="save" value="  Add New <: articleType:>  ">
    <:or:>
-  <:if UserCan edit_save article:><input type="submit" name="save" value="  Update <: articleType:>  "><:or UserCan:><:eif UserCan:>
+  <:if UserCan edit_save:article:><input type="submit" name="save" value="  Update <: articleType:>  "><:or UserCan:><:eif UserCan:>
    <:eif:></p>
   </form>
 <:if children:> <:ifEq [article id] 3:> 
           <th>Listed</th>
           <th nowrap>Modify</th>
         </tr>
-<:if UserCan edit_reorder_children:>
+<:if UserCan edit_reorder_children:article:>
         <tr> 
           <td colspan="4" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
           <td width="70%"><: summary child body :></td>
           <td align="center"><: is child listed :></td>
           <td nowrap> <a href="/cgi-bin/admin/add.pl?id=<:child id:>">Edit</a> 
-            <:if UserCan edit_delete_article child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
+            <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
             <:movechild:> </td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
 <:if HaveChildType:>
 <:if new:>
 <:or new:>
-<:if UserCan edit_add_child article:><form action="/cgi-bin/admin/add.pl">
+<:if UserCan edit_add_child:article:><form action="/cgi-bin/admin/add.pl">
 <input type=hidden name="parentid" value="<:article id:>">
   <p> 
     <input type=submit value="Add <:ifEq [article id] 3:>Catalog<:or:><: childtype :><:eif:>">
index 25d3e4b..9c90963 100644 (file)
     <input type="submit" name="save"
            value="  Add New Catalog  ">
      <: or :>
-    <:if UserCan edit_save article:><input type="submit" name="save"
+    <:if UserCan edit_save:article:><input type="submit" name="save"
            value="  Update Catalog  "><:or UserCan:><:eif UserCan:><:eif:></p>
   </form>
 <:if children:>
           <th>Listed</th>
           <th nowrap>Modify</th>
         </tr>
-<:if UserCan edit_reorder_children:>
+<:if UserCan edit_reorder_children:article:>
         <tr> 
           <td colspan="4" bgcolor="#FFFFFF">Reorder child articles: <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=title&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
             title</a> | <a href="/cgi-bin/admin/reorder.pl?parentid=<:article id:>&sort=date&refreshto=/cgi-bin/admin/add.pl?id=<:article id:>">by 
           <td width="30%"><a href="<:child admin:>"><:child title:></a></td>
           <td width="70%"><: summary child body :></td>
           <td align="center"><: is child listed :></td>
-          <td nowrap> <: edit child Edit :> <:if UserCan edit_delete_article child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifMatch [child generator] "Product":>Product<:or:>Sub-catalog<:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
+          <td nowrap> <: edit child Edit :> <:if UserCan edit_delete_article:child:><a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifMatch [child generator] "Product":>Product<:or:>Sub-catalog<:eif:>')">Delete</a><:or UserCan:><:eif UserCan:>
          <:movechild:> </td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
 <:if HaveChildType:>
 <:if new:>
 <:or new:>
-<:if UserCan edit_add_child article:>
+<:if UserCan edit_add_child:article:>
 <p>
 <form action="/cgi-bin/admin/add.pl" method="POST">
 <input type=hidden name="parentid" value="<:article id:>">
index 1b656b8..b4d9ecd 100644 (file)
       </td>
     </tr>
   </table>
-  <:if UserCan edit_save article:><p>
+  <:if UserCan edit_save:article:><p>
     <input type=submit name="save" value="Save changes">
   </p><:or UserCan:><:eif UserCan:>
 </form>
index 233bff6..7f28f4b 100644 (file)
@@ -13,7 +13,7 @@
 <:ifMessage:>
 <p><b><:message:></b></p>
 <:or:><:eif:> 
-<:if UserCan edit_files_add article:>
+<:if UserCan edit_files_add:article :>
 <h2>Add new file</h2>
 
 <form method="post" action="<:script:>" enctype="multipart/form-data">
           <tr bgcolor="#FFFFFF"> 
             <td nowrap> <:file displayName:></td>
             <td valign="top"> 
-              <:ifUserCan edit_files_save article:><input type="text" name="description_<:file id:>" value="<: file description :>" /><:or:><: file description :><:eif:>
+              <:ifUserCan edit_files_save:article:><input type="text" name="description_<:file id:>" value="<: file description :>" /><:or:><: file description :><:eif:>
             </td>
             <td valign="top"> 
-               <:ifUserCan edit_files_save article:><input type="text" name="contentType_<:file id:>" value="<: file contentType :>" /><:or:><: file contentType :><:eif:>
+               <:ifUserCan edit_files_save:article:><input type="text" name="contentType_<:file id:>" value="<: file contentType :>" /><:or:><: file contentType :><:eif:>
             </td>
           </tr>
           <tr bgcolor="#FFFFFF"> 
             <td colspan="3"> 
               <table width="100%" border="0" cellspacing="0" cellpadding="0">
                 <tr bgcolor="#FFFFFF"> 
-                  <td valign="top" align="center" nowrap> <:if UserCan edit_files_save article:><input type="checkbox" name="download_<:file id:>"
+                  <td valign="top" align="center" nowrap> <:if UserCan edit_files_save:article:><input type="checkbox" name="download_<:file id:>"
                     <:ifFile download:> checked<:or:><:eif:> /><:or UserCan:><img src="/images/admin/<:ifFile download:>checked.gif<:or:>unchecked.gif<:eif:>" width="16" height="16" /><:eif UserCan:>Download&nbsp;&nbsp;&nbsp;</td>
-                  <td valign="top" align="center" nowrap> <:if UserCan edit_files_save article:><input type="checkbox" name="forSale_<:file id:>"
+                  <td valign="top" align="center" nowrap> <:if UserCan edit_files_save:article:><input type="checkbox" name="forSale_<:file id:>"
                     <:ifFile forSale:> checked<:or:><:eif:> /><:or UserCan:><img src="/images/admin/<:ifFile forSale:>checked.gif<:or:>unchecked.gif<:eif:>" width="16" height="16" /><:eif UserCan:>Require payment&nbsp;&nbsp;&nbsp;</td>
-                  <td valign="top" align="center" nowrap> <:if UserCan edit_files_save article:><input type="checkbox" name="requireUser_<:file id:>"
+                  <td valign="top" align="center" nowrap> <:if UserCan edit_files_save:article:><input type="checkbox" name="requireUser_<:file id:>"
                     <:ifFile requireUser:> checked<:or:><:eif:> /><:or UserCan:><img src="/images/admin/<:ifFile requireUser:>checked.gif<:or:>unchecked.gif<:eif:>" width="16" height="16" /><:eif UserCan:>Require login 
                     &nbsp;&nbsp;&nbsp;</td>
-                  <td nowrap align="right" width="100%"> <:ifUserCan edit_files_delete article:><b><a href="<:script:>?filedel=1&amp;id=<:article id:>&amp;file=<:file id:>" onClick="return window.confirm('Are you sure you want to delete this File')">Delete</a></b> <:or:><:eif:>
+                  <td nowrap align="right" width="100%"> <:ifUserCan edit_files_delete:article:><b><a href="<:script:>?filedel=1&amp;id=<:article id:>&amp;file=<:file id:>" onClick="return window.confirm('Are you sure you want to delete this File')">Delete</a></b> <:or:><:eif:>
                     <:movefiles:></td>
                 </tr>
               </table>
             <td colspan="3">&nbsp;</td>
           </tr>
           <: iterator end files :> 
-<:ifUserCan edit_files_save article:>
+<:ifUserCan edit_files_save:article:>
           <tr> 
             <td colspan="3" align="right" valign="bottom" bgcolor="#FFFFFF"> 
               <input type="submit" name="filesave" value="  Save changes  " />