Fix deleting projects
authorMatthias Schmidt <gravatronics@live.com>
Sun, 23 Jul 2017 07:31:43 +0000 (09:31 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 23 Jul 2017 07:51:55 +0000 (09:51 +0200)
See #2331

wcfsetup/install/files/acp/templates/devtoolsProjectList.tpl
wcfsetup/install/files/lib/data/devtools/project/DevtoolsProjectAction.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index c763f85f24f2615ec8bc5a9f29cc7d2113c3392e..c4d6fce2734bc775b4423f87acdff52b195b0818 100644 (file)
@@ -2,7 +2,7 @@
 
 <script data-relocate="true">
        $(function() {
-               new WCF.Action.Delete('wcf\\data\\cronjob\\CronjobAction', '.jsObjectRow');
+               new WCF.Action.Delete('wcf\\data\\devtools\\project\\DevtoolsProjectAction', '.jsObjectRow');
        });
 </script>
 
index 0ff5cc0868520038ce1d6e47cdde6fd5b67cab9c..4154b6eb57171f6e9fffe60a06935118a479e00e 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\data\devtools\project;
 use wcf\data\AbstractDatabaseObjectAction;
+use wcf\system\exception\IllegalLinkException;
 
 /**
  * Executes devtools project related actions.
@@ -19,4 +20,25 @@ class DevtoolsProjectAction extends AbstractDatabaseObjectAction {
         * @inheritDoc
         */
        protected $className = DevtoolsProjectEditor::class;
+       
+       /**
+        * @inheritDoc
+        */
+       protected $requireACP = ['delete'];
+       
+       /**
+        * @inheritDoc
+        */
+       protected $permissionsDelete = ['admin.configuration.package.canInstallPackage'];
+       
+       /**
+        * @inheritDoc
+        */
+       public function validateDelete() {
+               if (!ENABLE_DEVELOPER_TOOLS) {
+                       throw new IllegalLinkException();
+               }
+               
+               parent::validateDelete();
+       }
 }
index e2bfc3ef2058ab8447c68a3870f8303a90e4e231..3950ca16185a744f634b43ac5e8363df789080b0 100644 (file)
                <item name="wcf.acp.devtools.project.action"><![CDATA[Aktionen]]></item>
                <item name="wcf.acp.devtools.project.add"><![CDATA[Projekt hinzufügen]]></item>
                <item name="wcf.acp.devtools.project.edit"><![CDATA[Projekt bearbeiten]]></item>
+               <item name="wcf.acp.devtools.project.delete.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} das Projekt <span class="confirmationObject">{$object->name}</span> wirklich löschen?]]></item>
                <item name="wcf.acp.devtools.project.list"><![CDATA[Projekte]]></item>
                <item name="wcf.acp.devtools.project.name"><![CDATA[Name]]></item>
                <item name="wcf.acp.devtools.project.path"><![CDATA[Pfad]]></item>
index 605d69e8af75bc60b137fbfc3885e8eb46026481..ed702e26aab0a8d5afb01bc7732e432693812473 100644 (file)
                <item name="wcf.acp.devtools.project.action"><![CDATA[Actions]]></item>
                <item name="wcf.acp.devtools.project.add"><![CDATA[Add Project]]></item>
                <item name="wcf.acp.devtools.project.edit"><![CDATA[Edit Project]]></item>
+               <item name="wcf.acp.devtools.project.delete.confirmMessage"><![CDATA[Do you really want to delete the project <span class="confirmationObject">{$object->name}</span>?]]></item>
                <item name="wcf.acp.devtools.project.list"><![CDATA[Projects]]></item>
                <item name="wcf.acp.devtools.project.name"><![CDATA[Name]]></item>
                <item name="wcf.acp.devtools.project.path"><![CDATA[Path]]></item>