From 244621b05f277ea7cd2155e564c8a62d7cd4c11e Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Thu, 20 Aug 2020 18:28:10 +0200 Subject: [PATCH 1/3] generated new locale files --- locale/{workflow.pot => cl-workflow.pot} | 556 ++++++++-------- locale/de_DE/LC_MESSAGES/cl-workflow.mo | Bin 0 -> 6602 bytes .../{workflow.po => cl-workflow.po} | 630 +++++++++--------- locale/de_DE/LC_MESSAGES/workflow.mo | Bin 6472 -> 0 bytes locale/potfiles.txt | 33 +- 5 files changed, 604 insertions(+), 615 deletions(-) rename locale/{workflow.pot => cl-workflow.pot} (54%) create mode 100644 locale/de_DE/LC_MESSAGES/cl-workflow.mo rename locale/de_DE/LC_MESSAGES/{workflow.po => cl-workflow.po} (63%) delete mode 100644 locale/de_DE/LC_MESSAGES/workflow.mo diff --git a/locale/workflow.pot b/locale/cl-workflow.pot similarity index 54% rename from locale/workflow.pot rename to locale/cl-workflow.pot index fee7346..57ea508 100644 --- a/locale/workflow.pot +++ b/locale/cl-workflow.pot @@ -8,162 +8,371 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-18 11:03+0200\n" +"POT-Creation-Date: 2020-08-20 18:04+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: includes/config.plugin.php:40 includes/include.workflow_list.php:71 -msgid "Delete workflow" +#: classes/class.workflowusersequence.php:105 +msgid "Workflow item doesn't exist. Can't create entry." msgstr "" -#: includes/config.plugin.php:41 -msgid "Select workflow task" +#: classes/class.workflowusersequence.php:129 +#: classes/class.workflowusersequence.php:137 +#: classes/class.workflowitems.php:125 classes/class.workflowitems.php:133 +msgid "Swapping items failed: Item doesn't exist" msgstr "" -#: includes/config.plugin.php:42 -msgid "Show workflow" +#: classes/class.workflowusersequence.php:212 +msgid "Can't set user_id: User or group doesn't exist" msgstr "" -#: includes/config.plugin.php:43 includes/include.workflow_left_top.php:37 -msgid "Create workflow" +#: classes/class.workflowactions.php:69 +msgid "Publish article" msgstr "" -#: includes/config.plugin.php:44 includes/include.workflow_edit.php:89 -msgid "Edit workflow" +#: classes/class.workflowactions.php:70 +msgid "Lock article" msgstr "" -#: includes/config.plugin.php:45 -msgid "Process workflow step" +#: classes/class.workflowactions.php:71 +msgid "Move back to last editor" msgstr "" -#: includes/config.plugin.php:46 includes/config.plugin.php:47 -#: includes/config.plugin.php:178 -msgid "Inherit workflow down" +#: classes/class.workflowactions.php:72 includes/functions.workflow.php:170 +msgid "Reject article" msgstr "" -#: includes/config.plugin.php:48 includes/include.workflow_steps.php:292 -msgid "Edit workflow step" +#: classes/class.workflowactions.php:73 +msgid "Edit article content" msgstr "" -#: includes/config.plugin.php:49 -msgid "Move workflowstep up" +#: classes/class.workflowactions.php:74 +msgid "Edit article properties" msgstr "" -#: includes/config.plugin.php:50 -msgid "Move workflowstep down" +#: classes/class.workflowactions.php:75 +msgid "Edit template" msgstr "" -#: includes/config.plugin.php:51 -msgid "Save Workflowstep" +#: classes/class.workflowactions.php:76 includes/functions.workflow.php:178 +msgid "Revise article" msgstr "" -#: includes/config.plugin.php:52 -msgid "Create workflowstep" +#: classes/class.workflowartallocation.php:67 +msgid "Article doesn't exist" msgstr "" -#: includes/config.plugin.php:53 -msgid "Delete workflowstep" +#: classes/class.workflowartallocation.php:74 +msgid "Article is already assigned to a usersequence step." msgstr "" -#: includes/config.plugin.php:54 -msgid "Move workflowstepuser up" +#: classes/class.workflowartallocation.php:265 +#: classes/class.workflowartallocation.php:273 +msgid "Workflow notification" msgstr "" -#: includes/config.plugin.php:55 -msgid "Move workflowstepuser down" +#: classes/class.workflowartallocation.php:311 +#: classes/class.workflowartallocation.php:320 +msgid "Workflow escalation" msgstr "" -#: includes/config.plugin.php:56 -msgid "Create Workflowstepuser" +#: classes/class.workflowitems.php:158 +msgid "Can't add item to workflow: Workflow doesn't exist" msgstr "" -#: includes/config.plugin.php:57 -msgid "Delete Workflowstepuser" +#: classes/class.workflowitems.php:233 +msgid "No item loaded" msgstr "" -#: includes/config.plugin.php:58 -msgid "Associate workflow with category" +#: classes/class.workflowitems.php:253 +msgid "Requested task doesn't exist, can't assign" msgstr "" -#: includes/config.plugin.php:165 includes/config.plugin.php:421 -#: includes/config.plugin.php:427 includes/include.workflow_tasks.php:233 -#: includes/functions.workflow.php:54 includes/functions.workflow.php:356 -msgid "None" +#: classes/class.workflowitems.php:274 classes/class.workflowallocation.php:114 +#: classes/class.workflowallocation.php:181 +msgid "Workflow doesn't exist" msgstr "" -#: includes/config.plugin.php:197 -msgid "Workflow" +#: classes/class.workflowitems.php:281 +msgid "Position in this workflow already exists." msgstr "" -#: includes/config.plugin.php:300 includes/include.workflow_tasks.php:157 -msgid "Workflow Step" +#: classes/class.workflowallocation.php:106 +#: classes/class.workflowallocation.php:203 +msgid "Category already has a workflow assigned" msgstr "" -#: includes/config.plugin.php:301 includes/include.workflow_tasks.php:158 -msgid "Workflow Action" +#: classes/class.workflowallocation.php:212 +msgid "Category doesn't exist, assignment failed" msgstr "" -#: includes/config.plugin.php:302 includes/include.workflow_tasks.php:159 -msgid "Workflow Editor" -msgstr "" - -#: includes/config.plugin.php:303 includes/include.workflow_tasks.php:160 -msgid "Last status" -msgstr "" - -#: includes/include.workflow_tasks.php:140 +#: includes/include.workflow_tasks.php:124 msgid "Show users" msgstr "" -#: includes/include.workflow_tasks.php:148 +#: includes/include.workflow_tasks.php:132 msgid "Search results" msgstr "" -#: includes/include.workflow_tasks.php:148 +#: includes/include.workflow_tasks.php:132 msgid "Workflow tasks" msgstr "" -#: includes/include.workflow_tasks.php:151 +#: includes/include.workflow_tasks.php:135 msgid "Article" msgstr "" -#: includes/include.workflow_tasks.php:152 +#: includes/include.workflow_tasks.php:136 msgid "Template" msgstr "" -#: includes/include.workflow_tasks.php:153 -#: includes/include.workflow_steps.php:300 +#: includes/include.workflow_tasks.php:137 +#: includes/include.workflow_steps.php:297 msgid "Actions" msgstr "" -#: includes/include.workflow_tasks.php:154 +#: includes/include.workflow_tasks.php:138 msgid "Title" msgstr "" -#: includes/include.workflow_tasks.php:155 +#: includes/include.workflow_tasks.php:139 msgid "Changed" msgstr "" -#: includes/include.workflow_tasks.php:156 +#: includes/include.workflow_tasks.php:140 msgid "Published" msgstr "" -#: includes/include.workflow_tasks.php:225 +#: includes/include.workflow_tasks.php:141 includes/functions.workflow.php:730 +msgid "Workflow Step" +msgstr "" + +#: includes/include.workflow_tasks.php:142 includes/functions.workflow.php:731 +msgid "Workflow Action" +msgstr "" + +#: includes/include.workflow_tasks.php:143 includes/functions.workflow.php:732 +msgid "Workflow Editor" +msgstr "" + +#: includes/include.workflow_tasks.php:144 includes/functions.workflow.php:733 +msgid "Last status" +msgstr "" + +#: includes/include.workflow_tasks.php:205 msgid "Reminder" msgstr "" -#: includes/include.workflow_tasks.php:226 +#: includes/include.workflow_tasks.php:206 msgid "Set reminder / add to todo list" msgstr "" -#: includes/include.workflow_tasks.php:262 +#: includes/include.workflow_tasks.php:213 includes/functions.workflow.php:43 +#: includes/functions.workflow.php:311 includes/functions.workflow.php:611 +#: includes/functions.workflow.php:841 includes/functions.workflow.php:847 +msgid "None" +msgstr "" + +#: includes/include.workflow_tasks.php:242 msgid "No article found." msgstr "" +#: includes/include.workflow_left_top.php:37 includes/config.plugin.php:39 +msgid "Create workflow" +msgstr "" + +#: includes/config.plugin.php:36 includes/include.workflow_list.php:69 +msgid "Delete workflow" +msgstr "" + +#: includes/config.plugin.php:37 +msgid "Select workflow task" +msgstr "" + +#: includes/config.plugin.php:38 +msgid "Show workflow" +msgstr "" + +#: includes/config.plugin.php:40 includes/include.workflow_edit.php:89 +msgid "Edit workflow" +msgstr "" + +#: includes/config.plugin.php:41 +msgid "Process workflow step" +msgstr "" + +#: includes/config.plugin.php:42 includes/config.plugin.php:43 +#: includes/functions.workflow.php:623 +msgid "Inherit workflow down" +msgstr "" + +#: includes/config.plugin.php:44 includes/include.workflow_steps.php:289 +msgid "Edit workflow step" +msgstr "" + +#: includes/config.plugin.php:45 +msgid "Move workflowstep up" +msgstr "" + +#: includes/config.plugin.php:46 +msgid "Move workflowstep down" +msgstr "" + +#: includes/config.plugin.php:47 +msgid "Save Workflowstep" +msgstr "" + +#: includes/config.plugin.php:48 +msgid "Create workflowstep" +msgstr "" + +#: includes/config.plugin.php:49 +msgid "Delete workflowstep" +msgstr "" + +#: includes/config.plugin.php:50 +msgid "Move workflowstepuser up" +msgstr "" + +#: includes/config.plugin.php:51 +msgid "Move workflowstepuser down" +msgstr "" + +#: includes/config.plugin.php:52 +msgid "Create Workflowstepuser" +msgstr "" + +#: includes/config.plugin.php:53 +msgid "Delete Workflowstepuser" +msgstr "" + +#: includes/config.plugin.php:54 +msgid "Associate workflow with category" +msgstr "" + +#: includes/functions.workflow.php:154 +msgid "Confirm" +msgstr "" + +#: includes/functions.workflow.php:162 +msgid "Back to last editor" +msgstr "" + +#: includes/functions.workflow.php:299 +msgid "Rejected" +msgstr "" + +#: includes/functions.workflow.php:302 +msgid "Revised" +msgstr "" + +#: includes/functions.workflow.php:305 +msgid "Last" +msgstr "" + +#: includes/functions.workflow.php:308 +msgid "Confirmed" +msgstr "" + +#: includes/functions.workflow.php:639 +msgid "Workflow" +msgstr "" + +#: includes/include.workflow_steps.php:43 +#: includes/include.workflow_steps.php:385 +msgid "Add User" +msgstr "" + +#: includes/include.workflow_steps.php:75 +msgid "New Workflow Step" +msgstr "" + +#: includes/include.workflow_steps.php:139 +msgid "Seconds" +msgstr "" + +#: includes/include.workflow_steps.php:140 +msgid "Minutes" +msgstr "" + +#: includes/include.workflow_steps.php:141 +msgid "Hours" +msgstr "" + +#: includes/include.workflow_steps.php:142 +msgid "Days" +msgstr "" + +#: includes/include.workflow_steps.php:143 +msgid "Weeks" +msgstr "" + +#: includes/include.workflow_steps.php:144 +msgid "Months" +msgstr "" + +#: includes/include.workflow_steps.php:145 +msgid "Years" +msgstr "" + +#: includes/include.workflow_steps.php:194 +msgid "Move step up" +msgstr "" + +#: includes/include.workflow_steps.php:202 +msgid "Move step down" +msgstr "" + +#: includes/include.workflow_steps.php:212 +msgid "Delete step" +msgstr "" + +#: includes/include.workflow_steps.php:254 +msgid "Create new step" +msgstr "" + +#: includes/include.workflow_steps.php:290 +msgid "Step name" +msgstr "" + +#: includes/include.workflow_steps.php:291 +msgid "Step description" +msgstr "" + +#: includes/include.workflow_steps.php:298 +msgid "Assigned users" +msgstr "" + +#: includes/include.workflow_steps.php:326 +msgid "Move user up" +msgstr "" + +#: includes/include.workflow_steps.php:335 +msgid "Move user down" +msgstr "" + +#: includes/include.workflow_steps.php:346 +msgid "Delete user" +msgstr "" + +#: includes/include.workflow_steps.php:352 +msgid "Notify this user via E-Mail" +msgstr "" + +#: includes/include.workflow_steps.php:353 +msgid "Escalate to this user via E-Mail" +msgstr "" + +#: includes/include.workflow_list.php:70 +#, php-format +msgid "Do you really want to delete the following workflow:

%s
" +msgstr "" + #: includes/include.workflow_edit.php:86 msgid "New Workflow" msgstr "" @@ -187,212 +396,3 @@ msgstr "" #: includes/include.workflow_edit.php:100 msgid "Created" msgstr "" - -#: includes/include.workflow_list.php:72 -#, php-format -msgid "Do you really want to delete the following workflow:

%s
" -msgstr "" - -#: includes/include.workflow_steps.php:46 -#: includes/include.workflow_steps.php:388 -msgid "Add User" -msgstr "" - -#: includes/include.workflow_steps.php:78 -msgid "New Workflow Step" -msgstr "" - -#: includes/include.workflow_steps.php:142 -msgid "Seconds" -msgstr "" - -#: includes/include.workflow_steps.php:143 -msgid "Minutes" -msgstr "" - -#: includes/include.workflow_steps.php:144 -msgid "Hours" -msgstr "" - -#: includes/include.workflow_steps.php:145 -msgid "Days" -msgstr "" - -#: includes/include.workflow_steps.php:146 -msgid "Weeks" -msgstr "" - -#: includes/include.workflow_steps.php:147 -msgid "Months" -msgstr "" - -#: includes/include.workflow_steps.php:148 -msgid "Years" -msgstr "" - -#: includes/include.workflow_steps.php:197 -msgid "Move step up" -msgstr "" - -#: includes/include.workflow_steps.php:205 -msgid "Move step down" -msgstr "" - -#: includes/include.workflow_steps.php:215 -msgid "Delete step" -msgstr "" - -#: includes/include.workflow_steps.php:257 -msgid "Create new step" -msgstr "" - -#: includes/include.workflow_steps.php:293 -msgid "Step name" -msgstr "" - -#: includes/include.workflow_steps.php:294 -msgid "Step description" -msgstr "" - -#: includes/include.workflow_steps.php:301 -msgid "Assigned users" -msgstr "" - -#: includes/include.workflow_steps.php:329 -msgid "Move user up" -msgstr "" - -#: includes/include.workflow_steps.php:338 -msgid "Move user down" -msgstr "" - -#: includes/include.workflow_steps.php:349 -msgid "Delete user" -msgstr "" - -#: includes/include.workflow_steps.php:355 -msgid "Notify this user via E-Mail" -msgstr "" - -#: includes/include.workflow_steps.php:356 -msgid "Escalate to this user via E-Mail" -msgstr "" - -#: includes/functions.workflow.php:183 -msgid "Confirm" -msgstr "" - -#: includes/functions.workflow.php:192 -msgid "Back to last editor" -msgstr "" - -#: includes/functions.workflow.php:201 classes/class.workflowactions.php:77 -msgid "Reject article" -msgstr "" - -#: includes/functions.workflow.php:210 classes/class.workflowactions.php:81 -msgid "Revise article" -msgstr "" - -#: includes/functions.workflow.php:344 -msgid "Rejected" -msgstr "" - -#: includes/functions.workflow.php:347 -msgid "Revised" -msgstr "" - -#: includes/functions.workflow.php:350 -msgid "Last" -msgstr "" - -#: includes/functions.workflow.php:353 -msgid "Confirmed" -msgstr "" - -#: classes/class.workflowartallocation.php:72 -msgid "Article doesn't exist" -msgstr "" - -#: classes/class.workflowartallocation.php:80 -msgid "Article is already assigned to a usersequence step." -msgstr "" - -#: classes/class.workflowartallocation.php:286 -#: classes/class.workflowartallocation.php:295 -msgid "Workflow notification" -msgstr "" - -#: classes/class.workflowartallocation.php:336 -#: classes/class.workflowartallocation.php:346 -msgid "Workflow escalation" -msgstr "" - -#: classes/class.workflowallocation.php:117 -#: classes/class.workflowallocation.php:223 -msgid "Category already has a workflow assigned" -msgstr "" - -#: classes/class.workflowallocation.php:126 -#: classes/class.workflowallocation.php:199 -#: classes/class.workflowitems.php:299 -msgid "Workflow doesn't exist" -msgstr "" - -#: classes/class.workflowallocation.php:233 -msgid "Category doesn't exist, assignment failed" -msgstr "" - -#: classes/class.workflowitems.php:133 classes/class.workflowitems.php:142 -#: classes/class.workflowusersequence.php:139 -#: classes/class.workflowusersequence.php:148 -msgid "Swapping items failed: Item doesn't exist" -msgstr "" - -#: classes/class.workflowitems.php:169 -msgid "Can't add item to workflow: Workflow doesn't exist" -msgstr "" - -#: classes/class.workflowitems.php:251 -msgid "No item loaded" -msgstr "" - -#: classes/class.workflowitems.php:276 -msgid "Requested task doesn't exist, can't assign" -msgstr "" - -#: classes/class.workflowitems.php:307 -msgid "Position in this workflow already exists." -msgstr "" - -#: classes/class.workflowactions.php:74 -msgid "Publish article" -msgstr "" - -#: classes/class.workflowactions.php:75 -msgid "Lock article" -msgstr "" - -#: classes/class.workflowactions.php:76 -msgid "Move back to last editor" -msgstr "" - -#: classes/class.workflowactions.php:78 -msgid "Edit article content" -msgstr "" - -#: classes/class.workflowactions.php:79 -msgid "Edit article properties" -msgstr "" - -#: classes/class.workflowactions.php:80 -msgid "Edit template" -msgstr "" - -#: classes/class.workflowusersequence.php:112 -msgid "Workflow item doesn't exist. Can't create entry." -msgstr "" - -#: classes/class.workflowusersequence.php:229 -msgid "Can't set user_id: User or group doesn't exist" -msgstr "" diff --git a/locale/de_DE/LC_MESSAGES/cl-workflow.mo b/locale/de_DE/LC_MESSAGES/cl-workflow.mo new file mode 100644 index 0000000000000000000000000000000000000000..a5ec096a6f5f0fd46ec7aa1d41e1fa03b0aeb755 GIT binary patch literal 6602 zcma)=TZ~;*8ON7g6k8MoRJ;_IAT5`k)9G-r9){YvQA#^y>`W=Nn7Zfebk4j+Z1@GGzhe+I9EZ@}x})$c6UIaG2U@@MYn=l!q)FM*$f zn(tIuf2yoM3nk}I;05p(P~(0Lx57V{{3p~r=Wi+Ixg6^I4mbgCf>*#5sPSKh?}Fbf z`5kx}_2;35zk)K=>rnQ118V(Cm{jv#!Oz9eLdn;Fvdb;-N;n2(x1&(~{IdRFS^qqI zAMKAp$@Mh+Ap9=W_}@T{`wM&ze6!@mG-}?fpyX-555ZA*Jve zw;)?%o-6qScmwqp%I|-N(&v1Pqjk4JjoSv*z7tB`o8d>`0f=c#0Qoa1KbOKUK&|^Y zlw4nfTKA_=c73trZ_D=ILCO1S$$vop%!Mp2J6#UtA2+}exEJbs1f}n1A%Es^el-76 z@U^$0FVwnEAe8L-B$OV{mG$T0F6u8q>2(oGORsHE^V|-vhLdm>cHlI84oa_oL&eDs zoJaDUfYKv?l4lKm6n+Uxk7uC#?}z30m*EGfpN5k2Je1VFZiOF%mqN*P3zVLBmHZ4; zT(3a3%sdY7fM18w^N&z^XfUtFmb@9tU+#q0K_AKGML_{xX!G z{~pRNr{Ps_E5b>S8=%&mf@=5ScK9f~7Cr-;@I}~w|AktofpKJ?v66F;sm%jW_IL!! zPrnE?{@YM?eFaKx8CCtaLAKJ2Liyh$)V|C>?b`_`IllqfI`e%fd;J{Bj(>pKhu5L( z^e?D&ucVXYoP@H+5vX|wh zl2Lx3N9!?d{(OR8*|B==DPMNMF^XjTIOPaM@_dp~J=c^k2jNl5O_V(p`GX$mqdnWJ zO8MLcbaU?DYsItrRdR~+(wyErF`y%yUTa&k^Ex^PB45^{J)O?qinza<_xsCwh1}1n+(;R(8pqpd5QT{u_kDXbaj_YX)1cjV6|En+ zB;1i&_fU|eb!(7VuOBBu zHQTVn#gN3Mxo9T?zm@B0qu6%iC|lm7;AAO9tzOSV)q0s)TSO_u9Ui~4?6Bm*)ONg} z?|d`a^TMteg`FT?s;Cw$h#e})WiHvMY7gCNZo-ZAO5dvOTy@P=_VLY>x0aYG*LP=I ztZdH*l<&C^<$Jxrrh3^wX~)5`T*ypCb}h;*D)swocGbfG?2lipn)aOSM13|p2)ng4 zTVo6HUX^PT{hDcZ*?NTo+IAGCSaG;1Gi;Q(Gs@z`90+?ZMv8i{AFYPw5I&gyFqfBRi8&PEoTa2@CJ3_> ziDrX|IMH+m|tJSwkpiSe4n$OmE)0`XoSMwjn&yJPR zV>VXooV@5Tab507C(1&UcHcA5dhz-J`LnTEWWqEc< znr1eR+Ac{3=Fi=1He2WiNv{&aly#Oq;vR7A+GomY-o6xsKB06(xrj+fPhPUPIau38 zKFJdlT~~s{)r%BW-^_VzXJwvToH^&k?H-<zb<=`0rgSWXvAgor zB?pXr5}Ok0T#x*xjbOZ9tIwjrrIM z6V!|1mc2VpNn>_42p63lOUo}zv(In4DC`HJYx-_41H*3SbzNiLc}uxmQ*OnM^&<@B z_Te;r?9+_m?x1UnEk8Lmy=CUW%=ADbDZ%NXbl8|*TSn5rDgXl1nHK08?%v4)5e6CxMeTxwd_o5S8m6})SaBgijhOI zc5hc2EJe*;wzTB>td(_x@MJ=gBtQqV9CT}|QS2v&aORc`cJB%Kw%>&=E^JjSW=ESN z&07bf=JIJc7$rCdaxQr-SrK2e$krHX)e*79j4#R&Txcd733r|J-3!9?tg}7Kmio7K z`Jl_oqU%>IE-e8Eh7D0DzO@><8W&UT*$apM*=~LOwn^ZiwnUxDb}+k%jvt$4l<1wFR(Dl>3F7fG9sBkx6=W^ z;B}L{ckRKs;C5+ylKg#)8;@wbI=R5Kw%w%qENe*tW|%r5y{c+kF(`vS9V&7 zVlFB^^4B^InW>g&V4n>=H%YS74s`3dUcXCr==F(((Cl~HJ?WzKoSF%eb5TzNeI2T& zwW-U!S*SK1FHK#)&w#^@yQZBh_s+%Zjx8&iV_VC7j`q#-+rhlk#R{pJN9xV}YB~DF zz91fJRzeIlR=Z(`T5G}1+FEKmJOs<2qze}C7vz!hb}rx+9mI=r3w$Wl9SiOCcGeX( zU%1L}2*RG%S3s1WSqGBSp0KRfk>_ssUL7nO+v*iJ^sCz{+idtY9$KG^923_z;%;YM zejT$eS@in2w(Od6>wxuSp@+Je@}XU!2jRpOEf24_B4<{9QL6$zVQS4)+|_jX3UzIK z3qe{*KD;PK37pm)`W(@MNmgCq%4L>1$H-di{ChqWZR&|DZE48U(m7^1Yq$S58DbU* z^sP-g-2IHn6@r6U%Oi47twPfrbex&hc641Q-_vH%T&6zTb$xD>WFY#QsdGCA0^tI& za(bRM>I>!|4OQ8lMRPA(sv}~<{#z~11qBxW9vRO%U2nl{KC3on&@<0~`XDQ&LfJZW zH@BRTL@lvUC^DC!Puz72VW8{l;&7NXD#^SoS^d$|J!RV=Rk+WtXR)2Q{ z{f{eo)S*2H-t|1GDACvHEIOEx5s!mT1E0(HY4Cv?J0^&Wd|m!m$EMEBTI59? n-Ni\n" -"Language-Team: \n" +"Language-Team: CL-Dev \n" +"Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Basepath: M:\\Projekte_Persoenlich\\timo.hummel\\plugin_sources\\\n" +"X-Poedit-Basepath: M:/Projekte_Persoenlich/timo.hummel/plugin_sources\n" "X-Poedit-KeywordsList: i18n\n" +"X-Generator: Poedit 2.0.6\n" +"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: workflow\n" -#: includes/config.plugin.php:40 -#: includes/include.workflow_list.php:71 -msgid "Delete workflow" -msgstr "Workflow löschen" +#: classes/class.workflowusersequence.php:105 +msgid "Workflow item doesn't exist. Can't create entry." +msgstr "Workflow existiert nicht. Eintrag kann nicht erstellt werden." -#: includes/config.plugin.php:41 -msgid "Select workflow task" -msgstr "Workflow-Aufgabe auswählen" +#: classes/class.workflowusersequence.php:129 +#: classes/class.workflowusersequence.php:137 +#: classes/class.workflowitems.php:125 classes/class.workflowitems.php:133 +msgid "Swapping items failed: Item doesn't exist" +msgstr "Tausch der Einträge fehlgeschlagen: Eintrag nicht vorhanden" -#: includes/config.plugin.php:42 -msgid "Show workflow" -msgstr "Workflow zeigen" +#: classes/class.workflowusersequence.php:212 +msgid "Can't set user_id: User or group doesn't exist" +msgstr "Kann Benutzer-Id nicht zuweisen: Benutzer oder Gruppe nicht vorhanden" -#: includes/config.plugin.php:43 -#: includes/include.workflow_left_top.php:37 -msgid "Create workflow" -msgstr "Neuer Workflow" +#: classes/class.workflowactions.php:69 +msgid "Publish article" +msgstr "Artikel veröffentlichen" -#: includes/config.plugin.php:44 -#: includes/include.workflow_edit.php:89 -msgid "Edit workflow" -msgstr "Workflow bearbeiten" +#: classes/class.workflowactions.php:70 +msgid "Lock article" +msgstr "Artikel sperren" -#: includes/config.plugin.php:45 -msgid "Process workflow step" -msgstr "Workflow Schritt durchführen" +#: classes/class.workflowactions.php:71 +msgid "Move back to last editor" +msgstr "Zurück zum letzten Bearbeiter" -#: includes/config.plugin.php:46 -#: includes/config.plugin.php:47 -#: includes/config.plugin.php:178 -msgid "Inherit workflow down" -msgstr "Workflow nach unten vererben" +#: classes/class.workflowactions.php:72 includes/functions.workflow.php:170 +msgid "Reject article" +msgstr "Artikel ablehnen" -#: includes/config.plugin.php:48 -#: includes/include.workflow_steps.php:292 -msgid "Edit workflow step" -msgstr "Workflow Schritt bearbeiten" +#: classes/class.workflowactions.php:73 +msgid "Edit article content" +msgstr "Artikelinhalt bearbeiten" -#: includes/config.plugin.php:49 -msgid "Move workflowstep up" -msgstr "Workflowschritt nach oben verschieben" +#: classes/class.workflowactions.php:74 +msgid "Edit article properties" +msgstr "Artikeleigenschaften bearbeiten" -#: includes/config.plugin.php:50 -msgid "Move workflowstep down" -msgstr "Workflowschritt nach unten verschieben" +#: classes/class.workflowactions.php:75 +msgid "Edit template" +msgstr "Template bearbeiten" -#: includes/config.plugin.php:51 -msgid "Save Workflowstep" -msgstr "Workflowschritt speichen" +#: classes/class.workflowactions.php:76 includes/functions.workflow.php:178 +msgid "Revise article" +msgstr "Artikel überarbeiten" -#: includes/config.plugin.php:52 -msgid "Create workflowstep" -msgstr "Workflowschritt erstellen" +#: classes/class.workflowartallocation.php:67 +msgid "Article doesn't exist" +msgstr "Artikel existiert nicht." -#: includes/config.plugin.php:53 -msgid "Delete workflowstep" -msgstr "Workflowschritt löschen" +#: classes/class.workflowartallocation.php:74 +msgid "Article is already assigned to a usersequence step." +msgstr "Artikel ist bereits Benutzerschritt zugeordnet." -#: includes/config.plugin.php:54 -msgid "Move workflowstepuser up" -msgstr "Workflowschrittbenutzer nach oben verschieben" +#: classes/class.workflowartallocation.php:265 +#: classes/class.workflowartallocation.php:273 +msgid "Workflow notification" +msgstr "Workflow Notifikation" -#: includes/config.plugin.php:55 -msgid "Move workflowstepuser down" -msgstr "Workflowschrittbenutzer nach unten verschieben" +#: classes/class.workflowartallocation.php:311 +#: classes/class.workflowartallocation.php:320 +msgid "Workflow escalation" +msgstr "Workflow Steigerung" -#: includes/config.plugin.php:56 -msgid "Create Workflowstepuser" -msgstr "Workflowschrittbenutzer erstellen" +#: classes/class.workflowitems.php:158 +msgid "Can't add item to workflow: Workflow doesn't exist" +msgstr "" +"Zuordnung des Eintrags zum Workflow nicht möglich: Workflow existiert " +"nicht" -#: includes/config.plugin.php:57 -msgid "Delete Workflowstepuser" -msgstr "Workflowschrittbenutzer löschen" +#: classes/class.workflowitems.php:233 +msgid "No item loaded" +msgstr "Kein Eintrag geladen" -#: includes/config.plugin.php:58 -msgid "Associate workflow with category" -msgstr "Workflow zu Kategorien zuweisen" +#: classes/class.workflowitems.php:253 +msgid "Requested task doesn't exist, can't assign" +msgstr "Gewünschte Aufgabe existiert nicht, Zuordnung nicht möglich" -#: includes/config.plugin.php:165 -#: includes/config.plugin.php:421 -#: includes/config.plugin.php:427 -#: includes/include.workflow_tasks.php:233 -#: includes/functions.workflow.php:54 -#: includes/functions.workflow.php:356 -msgid "None" -msgstr "Kein" +#: classes/class.workflowitems.php:274 classes/class.workflowallocation.php:114 +#: classes/class.workflowallocation.php:181 +msgid "Workflow doesn't exist" +msgstr "Workflow existiert nicht" -#: includes/config.plugin.php:197 -msgid "Workflow" -msgstr "Workflow" +#: classes/class.workflowitems.php:281 +msgid "Position in this workflow already exists." +msgstr "Position existiert bereits in diesem Workflow." -#: includes/config.plugin.php:300 -#: includes/include.workflow_tasks.php:157 -msgid "Workflow Step" -msgstr "Workflow Schritt" +#: classes/class.workflowallocation.php:106 +#: classes/class.workflowallocation.php:203 +msgid "Category already has a workflow assigned" +msgstr "Kategorie ist bereits Workflow zugeordnet" -#: includes/config.plugin.php:301 -#: includes/include.workflow_tasks.php:158 -msgid "Workflow Action" -msgstr "Workflow Aktion" +#: classes/class.workflowallocation.php:212 +msgid "Category doesn't exist, assignment failed" +msgstr "Kategorie existiert nicht, Zuordnung fehlgeschlagen" -#: includes/config.plugin.php:302 -#: includes/include.workflow_tasks.php:159 -msgid "Workflow Editor" -msgstr "Workflow Bearbeiter" - -#: includes/config.plugin.php:303 -#: includes/include.workflow_tasks.php:160 -msgid "Last status" -msgstr "Letzter Status" - -#: includes/include.workflow_tasks.php:140 +#: includes/include.workflow_tasks.php:124 msgid "Show users" msgstr "Zeige Benutzer" -#: includes/include.workflow_tasks.php:148 +#: includes/include.workflow_tasks.php:132 msgid "Search results" msgstr "Suchergebnis" -#: includes/include.workflow_tasks.php:148 +#: includes/include.workflow_tasks.php:132 msgid "Workflow tasks" msgstr "Workflow Aufgaben" -#: includes/include.workflow_tasks.php:151 +#: includes/include.workflow_tasks.php:135 msgid "Article" msgstr "Artikel" -#: includes/include.workflow_tasks.php:152 +#: includes/include.workflow_tasks.php:136 msgid "Template" msgstr "Template" -#: includes/include.workflow_tasks.php:153 -#: includes/include.workflow_steps.php:300 +#: includes/include.workflow_tasks.php:137 +#: includes/include.workflow_steps.php:297 msgid "Actions" msgstr "Aktionen" -#: includes/include.workflow_tasks.php:154 +#: includes/include.workflow_tasks.php:138 msgid "Title" msgstr "Titel" -#: includes/include.workflow_tasks.php:155 +#: includes/include.workflow_tasks.php:139 msgid "Changed" msgstr "Geändert" -#: includes/include.workflow_tasks.php:156 +#: includes/include.workflow_tasks.php:140 msgid "Published" msgstr "Veröffentlichen" -#: includes/include.workflow_tasks.php:225 +#: includes/include.workflow_tasks.php:141 includes/functions.workflow.php:730 +msgid "Workflow Step" +msgstr "Workflow Schritt" + +#: includes/include.workflow_tasks.php:142 includes/functions.workflow.php:731 +msgid "Workflow Action" +msgstr "Workflow Aktion" + +#: includes/include.workflow_tasks.php:143 includes/functions.workflow.php:732 +msgid "Workflow Editor" +msgstr "Workflow Bearbeiter" + +#: includes/include.workflow_tasks.php:144 includes/functions.workflow.php:733 +msgid "Last status" +msgstr "Letzter Status" + +#: includes/include.workflow_tasks.php:205 msgid "Reminder" msgstr "Wiedervorlage" -#: includes/include.workflow_tasks.php:226 +#: includes/include.workflow_tasks.php:206 msgid "Set reminder / add to todo list" msgstr "Wiedervorlage / zur Todoliste hinzuf&uegen" -#: includes/include.workflow_tasks.php:262 -#, fuzzy +#: includes/include.workflow_tasks.php:213 includes/functions.workflow.php:43 +#: includes/functions.workflow.php:311 includes/functions.workflow.php:611 +#: includes/functions.workflow.php:841 includes/functions.workflow.php:847 +msgid "None" +msgstr "Kein" + +#: includes/include.workflow_tasks.php:242 msgid "No article found." -msgstr "Kein Artikel gefunden" +msgstr "Kein Artikel gefunden." + +#: includes/include.workflow_left_top.php:37 includes/config.plugin.php:39 +msgid "Create workflow" +msgstr "Neuer Workflow" + +#: includes/config.plugin.php:36 includes/include.workflow_list.php:69 +msgid "Delete workflow" +msgstr "Workflow löschen" + +#: includes/config.plugin.php:37 +msgid "Select workflow task" +msgstr "Workflow-Aufgabe auswählen" + +#: includes/config.plugin.php:38 +msgid "Show workflow" +msgstr "Workflow zeigen" + +#: includes/config.plugin.php:40 includes/include.workflow_edit.php:89 +msgid "Edit workflow" +msgstr "Workflow bearbeiten" + +#: includes/config.plugin.php:41 +msgid "Process workflow step" +msgstr "Workflow Schritt durchführen" + +#: includes/config.plugin.php:42 includes/config.plugin.php:43 +#: includes/functions.workflow.php:623 +msgid "Inherit workflow down" +msgstr "Workflow nach unten vererben" + +#: includes/config.plugin.php:44 includes/include.workflow_steps.php:289 +msgid "Edit workflow step" +msgstr "Workflow Schritt bearbeiten" + +#: includes/config.plugin.php:45 +msgid "Move workflowstep up" +msgstr "Workflowschritt nach oben verschieben" + +#: includes/config.plugin.php:46 +msgid "Move workflowstep down" +msgstr "Workflowschritt nach unten verschieben" + +#: includes/config.plugin.php:47 +msgid "Save Workflowstep" +msgstr "Workflowschritt speichen" + +#: includes/config.plugin.php:48 +msgid "Create workflowstep" +msgstr "Workflowschritt erstellen" + +#: includes/config.plugin.php:49 +msgid "Delete workflowstep" +msgstr "Workflowschritt löschen" + +#: includes/config.plugin.php:50 +msgid "Move workflowstepuser up" +msgstr "Workflowschrittbenutzer nach oben verschieben" + +#: includes/config.plugin.php:51 +msgid "Move workflowstepuser down" +msgstr "Workflowschrittbenutzer nach unten verschieben" + +#: includes/config.plugin.php:52 +msgid "Create Workflowstepuser" +msgstr "Workflowschrittbenutzer erstellen" + +#: includes/config.plugin.php:53 +msgid "Delete Workflowstepuser" +msgstr "Workflowschrittbenutzer löschen" + +#: includes/config.plugin.php:54 +msgid "Associate workflow with category" +msgstr "Workflow zu Kategorien zuweisen" + +#: includes/functions.workflow.php:154 +msgid "Confirm" +msgstr "Bestätigen" + +#: includes/functions.workflow.php:162 +msgid "Back to last editor" +msgstr "Zurück zum letzten Bearbeiter" + +#: includes/functions.workflow.php:299 +msgid "Rejected" +msgstr "Abgelehnt" + +#: includes/functions.workflow.php:302 +msgid "Revised" +msgstr "überarbeitet" + +#: includes/functions.workflow.php:305 +msgid "Last" +msgstr "Letzter" + +#: includes/functions.workflow.php:308 +msgid "Confirmed" +msgstr "Bestätigt" + +#: includes/functions.workflow.php:639 +msgid "Workflow" +msgstr "Workflow" + +#: includes/include.workflow_steps.php:43 +#: includes/include.workflow_steps.php:385 +msgid "Add User" +msgstr "Benutzer hinzufügen" + +#: includes/include.workflow_steps.php:75 +msgid "New Workflow Step" +msgstr "Neuer Workflow Schritt" + +#: includes/include.workflow_steps.php:139 +msgid "Seconds" +msgstr "Sekunden" + +#: includes/include.workflow_steps.php:140 +msgid "Minutes" +msgstr "Minuten" + +#: includes/include.workflow_steps.php:141 +msgid "Hours" +msgstr "Stunden" + +#: includes/include.workflow_steps.php:142 +msgid "Days" +msgstr "Tage" + +#: includes/include.workflow_steps.php:143 +msgid "Weeks" +msgstr "Wochen" + +#: includes/include.workflow_steps.php:144 +msgid "Months" +msgstr "Monate" + +#: includes/include.workflow_steps.php:145 +msgid "Years" +msgstr "Jahre" + +#: includes/include.workflow_steps.php:194 +msgid "Move step up" +msgstr "Schritt nach oben bewegen" + +#: includes/include.workflow_steps.php:202 +msgid "Move step down" +msgstr "Schritt nach unten verschieben" + +#: includes/include.workflow_steps.php:212 +msgid "Delete step" +msgstr "Schritt löschen" + +#: includes/include.workflow_steps.php:254 +msgid "Create new step" +msgstr "Neuen Schritt erzeugen" + +#: includes/include.workflow_steps.php:290 +msgid "Step name" +msgstr "Name des Schritts" + +#: includes/include.workflow_steps.php:291 +msgid "Step description" +msgstr "Beschreibung des Schritts" + +#: includes/include.workflow_steps.php:298 +msgid "Assigned users" +msgstr "Zugeordnete Benutzer" + +#: includes/include.workflow_steps.php:326 +msgid "Move user up" +msgstr "Benutzer nach oben verschieben" + +#: includes/include.workflow_steps.php:335 +msgid "Move user down" +msgstr "Benutzer nach unten verschieben" + +#: includes/include.workflow_steps.php:346 +msgid "Delete user" +msgstr "Benutzer löschen" + +#: includes/include.workflow_steps.php:352 +msgid "Notify this user via E-Mail" +msgstr "Diesen Benutzer per e-Mail benachrichtigen" + +#: includes/include.workflow_steps.php:353 +msgid "Escalate to this user via E-Mail" +msgstr "An diesen Benutzer per e-Mail eskalieren" + +#: includes/include.workflow_list.php:70 +#, php-format +msgid "Do you really want to delete the following workflow:

%s
" +msgstr "Wollen Sie wirklich den folgenden Workflow löschen:

%s
" #: includes/include.workflow_edit.php:86 msgid "New Workflow" @@ -198,218 +398,6 @@ msgstr "Autor" msgid "Created" msgstr "Erstellt" -#: includes/include.workflow_list.php:72 -#, php-format -msgid "Do you really want to delete the following workflow:

%s
" -msgstr "Wollen Sie wirklich den folgenden Workflow löschen:

%s
" - -#: includes/include.workflow_steps.php:46 -#: includes/include.workflow_steps.php:388 -msgid "Add User" -msgstr "Benutzer hinzufügen" - -#: includes/include.workflow_steps.php:78 -msgid "New Workflow Step" -msgstr "Neuer Workflow Schritt" - -#: includes/include.workflow_steps.php:142 -msgid "Seconds" -msgstr "Sekunden" - -#: includes/include.workflow_steps.php:143 -msgid "Minutes" -msgstr "Minuten" - -#: includes/include.workflow_steps.php:144 -msgid "Hours" -msgstr "Stunden" - -#: includes/include.workflow_steps.php:145 -msgid "Days" -msgstr "Tage" - -#: includes/include.workflow_steps.php:146 -msgid "Weeks" -msgstr "Wochen" - -#: includes/include.workflow_steps.php:147 -msgid "Months" -msgstr "Monate" - -#: includes/include.workflow_steps.php:148 -msgid "Years" -msgstr "Jahre" - -#: includes/include.workflow_steps.php:197 -msgid "Move step up" -msgstr "Schritt nach oben bewegen" - -#: includes/include.workflow_steps.php:205 -msgid "Move step down" -msgstr "Schritt nach unten verschieben" - -#: includes/include.workflow_steps.php:215 -msgid "Delete step" -msgstr "Schritt löschen" - -#: includes/include.workflow_steps.php:257 -msgid "Create new step" -msgstr "Neuen Schritt erzeugen" - -#: includes/include.workflow_steps.php:293 -msgid "Step name" -msgstr "Name des Schritts" - -#: includes/include.workflow_steps.php:294 -msgid "Step description" -msgstr "Beschreibung des Schritts" - -#: includes/include.workflow_steps.php:301 -msgid "Assigned users" -msgstr "Zugeordnete Benutzer" - -#: includes/include.workflow_steps.php:329 -msgid "Move user up" -msgstr "Benutzer nach oben verschieben" - -#: includes/include.workflow_steps.php:338 -msgid "Move user down" -msgstr "Benutzer nach unten verschieben" - -#: includes/include.workflow_steps.php:349 -msgid "Delete user" -msgstr "Benutzer löschen" - -#: includes/include.workflow_steps.php:355 -msgid "Notify this user via E-Mail" -msgstr "Diesen Benutzer per e-Mail benachrichtigen" - -#: includes/include.workflow_steps.php:356 -msgid "Escalate to this user via E-Mail" -msgstr "An diesen Benutzer per e-Mail eskalieren" - -#: includes/functions.workflow.php:183 -msgid "Confirm" -msgstr "Bestätigen" - -#: includes/functions.workflow.php:192 -msgid "Back to last editor" -msgstr "Zurück zum letzten Bearbeiter" - -#: includes/functions.workflow.php:201 -#: classes/class.workflowactions.php:77 -msgid "Reject article" -msgstr "Artikel ablehnen" - -#: includes/functions.workflow.php:210 -#: classes/class.workflowactions.php:81 -msgid "Revise article" -msgstr "Artikel überarbeiten" - -#: includes/functions.workflow.php:344 -msgid "Rejected" -msgstr "Abgelehnt" - -#: includes/functions.workflow.php:347 -msgid "Revised" -msgstr "überarbeitet" - -#: includes/functions.workflow.php:350 -msgid "Last" -msgstr "Letzter" - -#: includes/functions.workflow.php:353 -msgid "Confirmed" -msgstr "Bestätigt" - -#: classes/class.workflowartallocation.php:72 -msgid "Article doesn't exist" -msgstr "Artikel existiert nicht." - -#: classes/class.workflowartallocation.php:80 -msgid "Article is already assigned to a usersequence step." -msgstr "Artikel ist bereits Benutzerschritt zugeordnet." - -#: classes/class.workflowartallocation.php:286 -#: classes/class.workflowartallocation.php:295 -msgid "Workflow notification" -msgstr "Workflow Notifikation" - -#: classes/class.workflowartallocation.php:336 -#: classes/class.workflowartallocation.php:346 -msgid "Workflow escalation" -msgstr "Workflow Steigerung" - -#: classes/class.workflowallocation.php:117 -#: classes/class.workflowallocation.php:223 -msgid "Category already has a workflow assigned" -msgstr "Kategorie ist bereits Workflow zugeordnet" - -#: classes/class.workflowallocation.php:126 -#: classes/class.workflowallocation.php:199 -#: classes/class.workflowitems.php:299 -msgid "Workflow doesn't exist" -msgstr "Workflow existiert nicht" - -#: classes/class.workflowallocation.php:233 -msgid "Category doesn't exist, assignment failed" -msgstr "Kategorie existiert nicht, Zuordnung fehlgeschlagen" - -#: classes/class.workflowitems.php:133 -#: classes/class.workflowitems.php:142 -#: classes/class.workflowusersequence.php:139 -#: classes/class.workflowusersequence.php:148 -msgid "Swapping items failed: Item doesn't exist" -msgstr "Tausch der Einträge fehlgeschlagen: Eintrag nicht vorhanden" - -#: classes/class.workflowitems.php:169 -msgid "Can't add item to workflow: Workflow doesn't exist" -msgstr "Zuordnung des Eintrags zum Workflow nicht möglich: Workflow existiert nicht" - -#: classes/class.workflowitems.php:251 -msgid "No item loaded" -msgstr "Kein Eintrag geladen" - -#: classes/class.workflowitems.php:276 -msgid "Requested task doesn't exist, can't assign" -msgstr "Gewünschte Aufgabe existiert nicht, Zuordnung nicht möglich" - -#: classes/class.workflowitems.php:307 -msgid "Position in this workflow already exists." -msgstr "Position existiert bereits in diesem Workflow." - -#: classes/class.workflowactions.php:74 -msgid "Publish article" -msgstr "Artikel veröffentlichen" - -#: classes/class.workflowactions.php:75 -msgid "Lock article" -msgstr "Artikel sperren" - -#: classes/class.workflowactions.php:76 -msgid "Move back to last editor" -msgstr "Zurück zum letzten Bearbeiter" - -#: classes/class.workflowactions.php:78 -msgid "Edit article content" -msgstr "Artikelinhalt bearbeiten" - -#: classes/class.workflowactions.php:79 -msgid "Edit article properties" -msgstr "Artikeleigenschaften bearbeiten" - -#: classes/class.workflowactions.php:80 -msgid "Edit template" -msgstr "Template bearbeiten" - -#: classes/class.workflowusersequence.php:112 -msgid "Workflow item doesn't exist. Can't create entry." -msgstr "Workflow existiert nicht. Eintrag kann nicht erstellt werden." - -#: classes/class.workflowusersequence.php:229 -msgid "Can't set user_id: User or group doesn't exist" -msgstr "Kann Benutzer-Id nicht zuweisen: Benutzer oder Gruppe nicht vorhanden" - #~ msgid "Recently edited articles" #~ msgstr "Zuletzt bearbeitete Artikel" diff --git a/locale/de_DE/LC_MESSAGES/workflow.mo b/locale/de_DE/LC_MESSAGES/workflow.mo deleted file mode 100644 index c7808d53e6b92a4d02d0681a1bfe9c613cef3db0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6472 zcma)=TaX-88OM)+iUAel1w@b|m~hK%b`y~>gv)Mr31N4WH9I5_w#438pjH50)0Fl;w+Bmij=0IoC{wp>#xA~Q~x{M3(uwV zU2s3Na2CD|2JpQwfqUTR;TU`pUIkxe~9)s_OA=G*gmGy_q z`qv?%m>`$Sdw!)ybN9mF@-q@`7=lPxd46&YTuJka@`NL?-Nk= z{7%Uql<_e}g*Db5UX(UINuW52f!tkUw*hAFcmc_>H%qFVw!* zAe8L67fQdmvfhHbsrRAu`YM!O--lY~S$H{o4lcmg;0&C@IMVB3xEKByN}j($>G2;Z zdESLHeFR<#rN=EW_jjoN5PlFo2qov2q0aR&_)+)-lw7}n(({ic{|Ob(=V26%##{w& zgV#an`2dt2k3#;;4@>?W%3of9SHV}I>~T4pXuWHo>Ib3ZI|8N8C(HH_%D+!R+2uj_ zVfYx79zTWJ_xZB@Rk)M-MF_tG-U7#3hF$533Xo2L&+uKm{1Bl7Z15omQ0rF=aFWaAlH&Oo; zl>Fzj8743nL+v*Xwf+>uz4J9ssGm|j()R|+BIPWK&RMp+i-Nf37)8(R6v?Rb)}#Gc zHh=cN&)V{N@(Q zeA#$5RLtqoS?JvNP(DVvjv{*>p&X+IwoS5jsv2Ph4S9zxRGO_9HFe7Rqdrt|!GDcnWTa~nmztVd@$ zoxc_Fewg=r%6bL)xt?n&x9UaDWIOevFfo&zj=eK+v6+lhza6-WwiCG|yfU@!K0it8 zRzI;`5Ie84ZoMS&yP@mYG_sz}SR-*KGZ(g_M+HKdF@rL8F&f1cl?yL1D-_jkkwCJU%k~DO?$jrZB*i7O5)O7 zw0r$dGuP8bvF*lDHrS%zfl`WEy`G1v^)|J(h*F3->gD*P9s2{hkeQC`dX!mI3W9aJ=3xNNr&H{j_MBab0uI{`yR|i&`0P%%a0FJ7OSNYTdLUjVS{QVeIZaQOVt+4rxs3bFoLZli8WC*J`$r zp^24YH02GU*LP-d%^M69HA;C&nN*tgkP_f%s%urj(DG9<_;Ke}6I1C@zt|$>59^SmxGF+eKmEhivGeh|&#>ThtWl*YXwAKfRnY#PZ z-DEXCywSFM=O8tH`*30^R7c32etm}vOCL}<@acQ{BtXp4;;!ZM$?>4PJ zu`e9<6=AW!CXMlC?a15A}r=??EEyb)oMw*M|w`}M%HzR7COeCsNY>ZZs=qinVseMxmx%xWZs%1 z?vWys)1S!VLNL<#M%K4{A~!e+mhs|cHYTT>$h1#J01}^e#>a=fZjz54x~>Gb{hd*+ zqYS+1K9XmG*+i!M_Oya zPTN{)J30l+prrGc@fYNg@^;bZs_VzAatnMY)I|vG^>*4Fw%&@$aPY&P7bqY~&#VK< z=}g$xTao8(>aV^Bo7?IgH;t>?D%))8n+$D-+ZGGgHsS(iU4Cb>E?M;gTw8Wcv)nK1 z#X=8tGbJ{AiV=hp_ozI););A~^4nAu@Ci$6t>QwZ8&asd-J1x~O7hW7F^ccB??`t< z3np1}g)5g?>I^e$t@HkTD%#WwSK88$r=>Hja@t}4Z!yFy66l*-baeO|7FP%kV=a%! zVYLcPGwb-Gl{wCKUBHcxR70bgKC>6FGiMzu2j=Oaz5ovMO_j!3J$I*m?fRRp1Jx;Y z_zv~T4+g*an~(}zOI+6 zqw& zD)nu?tQLVc95nQ~eA{6MH)>1}7m2z2kB2RT$7+#R^^Gp%F26Qh^<7LfZ1Pu`X1IR- TPa=PH%k{N9wb0z*;mYQJ58dn) diff --git a/locale/potfiles.txt b/locale/potfiles.txt index bdb342d..08c5f0f 100644 --- a/locale/potfiles.txt +++ b/locale/potfiles.txt @@ -1,18 +1,19 @@ -./includes/include.workflow_subnav.php -./includes/config.plugin.php -./includes/include.workflow_tasks.php -./includes/include.workflow_edit.php -./includes/include.workflow_left_top.php -./includes/include.workflow_list.php -./includes/include.workflow_steps.php -./includes/functions.workflow.php -./cronjobs/advance_workflow.php +./classes/class.workflowusersequence.php +./classes/class.workflowactions.php +./classes/class.workflow.php +./classes/class.workflowartallocation.php +./classes/class.workflowitems.php +./classes/class.workflowallocation.php +./classes/class.workflowtasks.php ./templates/template.workflow_steps.html ./templates/template.workflow_tasks.html -./classes/class.workflowartallocation.php -./classes/class.workflowallocation.php -./classes/class.workflowitems.php -./classes/class.workflowactions.php -./classes/class.workflowtasks.php -./classes/class.workflowusersequence.php -./classes/class.workflow.php +./includes/include.workflow_tasks.php +./includes/include.workflow_left_top.php +./includes/config.autoloader.php +./includes/config.plugin.php +./includes/functions.workflow.php +./includes/include.workflow_steps.php +./includes/include.workflow_subnav.php +./includes/include.workflow_list.php +./includes/include.workflow_edit.php +./cronjobs/advance_workflow.php From e8b0c809216306f362968ad70151bffd9ac75bf7 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Thu, 20 Aug 2020 18:30:16 +0200 Subject: [PATCH 2/3] recoding to use as plugin with CL --- .gitignore | 1 + cl_plugin.xml | 61 ++ classes/class.workflow.php | 57 +- classes/class.workflowactions.php | 134 ++- classes/class.workflowallocation.php | 305 +++--- classes/class.workflowartallocation.php | 523 +++++----- classes/class.workflowtasks.php | 72 +- classes/class.workflowusersequence.php | 336 +++---- cronjobs/advance_workflow.php | 127 ++- includes/config.autoloader.php | 19 + includes/config.plugin.php | 442 +-------- includes/functions.workflow.php | 1195 ++++++++++++++--------- includes/include.workflow_edit.php | 16 +- includes/include.workflow_left_top.php | 2 +- includes/include.workflow_list.php | 77 +- includes/include.workflow_steps.php | 504 +++++----- includes/include.workflow_subnav.php | 100 +- includes/include.workflow_tasks.php | 314 +++--- plugin_install.sql | 11 + plugin_uninstall.sql | 6 + templates/template.workflow_steps.html | 8 +- templates/template.workflow_tasks.html | 218 +++-- 22 files changed, 2187 insertions(+), 2341 deletions(-) create mode 100644 .gitignore create mode 100644 cl_plugin.xml create mode 100644 includes/config.autoloader.php create mode 100644 plugin_install.sql create mode 100644 plugin_uninstall.sql diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d8fe4fa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.project diff --git a/cl_plugin.xml b/cl_plugin.xml new file mode 100644 index 0000000..48803f8 --- /dev/null +++ b/cl_plugin.xml @@ -0,0 +1,61 @@ + + + + ConLite Workflow + cl-workflow + 6BAFECC4-AF63-51CE-839D-A4E5FBBEB4A9 + ConLite Workflow adds a simple worflow management to your ConLite CMS + ConLite Team + ConLite Team + cl-workflow@conlite.org + https://conlite.org + 0.1.0 + GNU Lesser General Public License + + + + + + + workflow + workflow_common + workflow_steps + workflow_step_edit + con_workflow + + + workflow_show + workflow_create + workflow_save + workflow_delete + workflow_step_edit + workflow_step_up + workflow_step_down + workflow_save_step + workflow_create_step + workflow_step_delete + workflow_user_up + workflow_user_down + workflow_create_user + workflow_user_delete + workflow_cat_assign + workflow_do_action + workflow_inherit_down + workflow_task_user_select + workflow_do_action + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/classes/class.workflow.php b/classes/class.workflow.php index dc81865..842b5d5 100644 --- a/classes/class.workflow.php +++ b/classes/class.workflow.php @@ -30,20 +30,6 @@ if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } - -$cfg["tab"]["workflow"] = $cfg['sql']['sqlprefix'] . "_piwf_workflow"; -$cfg["tab"]["workflow_allocation"] = $cfg['sql']['sqlprefix'] . "_piwf_allocation"; -$cfg["tab"]["workflow_art_allocation"] = $cfg['sql']['sqlprefix'] . "_piwf_art_allocation"; -$cfg["tab"]["workflow_items"] = $cfg['sql']['sqlprefix'] . "_piwf_items"; -$cfg["tab"]["workflow_user_sequences"] = $cfg['sql']['sqlprefix'] . "_piwf_user_sequences"; -$cfg["tab"]["workflow_actions"] = $cfg['sql']['sqlprefix'] . "_piwf_actions"; - -plugin_include('workflow', 'classes/class.workflowactions.php'); -plugin_include('workflow', 'classes/class.workflowallocation.php'); -plugin_include('workflow', 'classes/class.workflowartallocation.php'); -plugin_include('workflow', 'classes/class.workflowitems.php'); -plugin_include('workflow', 'classes/class.workflowusersequence.php'); - /** * Class Workflows * Class for workflow management @@ -136,45 +122,4 @@ class Workflow extends Item { parent::__construct($cfg["tab"]["workflow"], "idworkflow"); } -} - -/* Helper functions */ - -function getWorkflowForCat($idcat) { - global $lang, $cfg; - - $idcatlang = getCatLang($idcat, $lang); - $workflows = new WorkflowAllocations; - $workflows->select("idcatlang = '$idcatlang'"); - if ($obj = $workflows->next()) { - /* Sanity: Check if the workflow still exists */ - $workflow = new Workflow; - - $res = $workflow->loadByPrimaryKey($obj->get("idworkflow")); - - if ($res == false) { - return 0; - } else { - return $obj->get("idworkflow"); - } - } -} - -function getCatLang($idcat, $idlang) { - global $lang, $cfg; - $db = new DB_ConLite; - - /* Get the idcatlang */ - $sql = "SELECT idcatlang FROM " - . $cfg["tab"]["cat_lang"] . - " WHERE idlang = '" . Contenido_Security::escapeDB($idlang, $db) . "' AND - idcat = '" . Contenido_Security::escapeDB($idcat, $db) . "'"; - - $db->query($sql); - - if ($db->next_record()) { - return ($db->f("idcatlang")); - } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/classes/class.workflowactions.php b/classes/class.workflowactions.php index 6814531..a3809ec 100644 --- a/classes/class.workflowactions.php +++ b/classes/class.workflowactions.php @@ -1,4 +1,5 @@ _setItemClass("WorkflowAction"); - } - - /** - * - * @param type $idworkflowitem - * @param type $action - * @return boolean - */ - function get($idworkflowitem, $action) - { - $this->select("idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."' AND action = '".Contenido_Security::escapeDB($action, NULL)."'"); - if ($this->next()) - { - return true; - } else { - return false; - } - } - - function getAvailableWorkflowActions () - { - $availableWorkflowActions = array ( - "publish" => i18n("Publish article", "workflow"), - "lock" => i18n("Lock article", "workflow"), - "last" => i18n("Move back to last editor", "workflow"), - "reject" => i18n("Reject article", "workflow"), - "articleedit" => i18n("Edit article content", "workflow"), - "propertyedit" => i18n("Edit article properties", "workflow"), - "templateedit" => i18n("Edit template", "workflow"), - "revise" => i18n("Revise article", "workflow")); - - return($availableWorkflowActions); - } + } + + /** + * + * @param type $idworkflowitem + * @param type $action + * @return boolean + */ + function get($idworkflowitem, $action) { + $this->select("idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "' AND action = '" . Contenido_Security::escapeDB($action, NULL) . "'"); + if ($this->next()) { + return true; + } else { + return false; + } + } + + function getAvailableWorkflowActions() { + $availableWorkflowActions = array( + "publish" => i18n("Publish article", "workflow"), + "lock" => i18n("Lock article", "workflow"), + "last" => i18n("Move back to last editor", "workflow"), + "reject" => i18n("Reject article", "workflow"), + "articleedit" => i18n("Edit article content", "workflow"), + "propertyedit" => i18n("Edit article properties", "workflow"), + "templateedit" => i18n("Edit template", "workflow"), + "revise" => i18n("Revise article", "workflow")); + + return($availableWorkflowActions); + } + + function set($idworkflowitem, $action) { + $this->select("idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "' AND action = '" . Contenido_Security::escapeDB($action, NULL) . "'"); + if (!$this->next()) { + $newitem = parent::createNewItem(); + $newitem->setField("idworkflowitem", $idworkflowitem); + $newitem->setField("action", $action); + $newitem->store(); + } + } + + function remove($idworkflowitem, $action) { + $this->select("idworkflowitem = '$idworkflowitem' AND action = '$action'"); + if ($item = $this->next()) { + $this->delete($item->getField("idworkflowaction")); + } + } + + function select($where = "", $group_by = "", $order_by = "", $limit = "") { + global $client; + + return parent::select($where, $group_by, $order_by, $limit); + } - function set ($idworkflowitem, $action) - { - $this->select("idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."' AND action = '".Contenido_Security::escapeDB($action, NULL)."'"); - if (!$this->next()) - { - $newitem = parent::createNewItem(); - $newitem->setField("idworkflowitem",$idworkflowitem); - $newitem->setField("action",$action); - $newitem->store(); - } - } - - function remove ($idworkflowitem, $action) - { - $this->select("idworkflowitem = '$idworkflowitem' AND action = '$action'"); - if ($item = $this->next()) - { - $this->delete($item->getField("idworkflowaction")); - } - } - - function select ($where = "", $group_by = "", $order_by = "", $limit = "") - { - global $client; - - return parent::select($where, $group_by, $order_by, $limit); - } } /** @@ -119,14 +111,16 @@ class WorkflowActions extends ItemCollection { * @copyright four for business 2003 */ class WorkflowAction extends Item { - + /** * Constructor * @global type $cfg */ - function __construct() { + function __construct() { global $cfg; parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction"); } + } + ?> \ No newline at end of file diff --git a/classes/class.workflowallocation.php b/classes/class.workflowallocation.php index 70444ef..164690b 100644 --- a/classes/class.workflowallocation.php +++ b/classes/class.workflowallocation.php @@ -1,4 +1,5 @@ _setItemClass("WorkflowAllocation"); - } - + } + /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - function WorkflowAllocations() - { + function WorkflowAllocations() { cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); $this->__construct(); } - function delete ($idallocation) - { - global $cfg, $lang; + function delete($idallocation) { + global $cfg, $lang; - $obj = new WorkflowAllocation; - $obj->loadByPrimaryKey($idallocation); - - $idcatlang = $obj->get("idcatlang"); + $obj = new WorkflowAllocation; + $obj->loadByPrimaryKey($idallocation); - $db = new DB_ConLite; - $sql = "SELECT idcat FROM ".$cfg["tab"]["cat_lang"]." WHERE idcatlang = '".Contenido_Security::toInteger($idcatlang)."'"; - $db->query($sql); - $db->next_record(); - $idcat = $db->f("idcat"); - - $sql = "SELECT idart FROM ".$cfg["tab"]["cat_art"]." WHERE idcat = '".Contenido_Security::toInteger($idcat)."'"; - $db->query($sql); - - while ($db->next_record()) - { - $idarts[] = $db->f("idart"); - } - - $idartlangs = array(); - - if (is_array($idarts)) - { - foreach ($idarts as $idart) - { - $sql = "SELECT idartlang FROM ".$cfg["tab"]["art_lang"]." WHERE idart = '".Contenido_Security::toInteger($idart)."' and idlang = '".Contenido_Security::toInteger($lang)."'"; - $db->query($sql); - if ($db->next_record()) - { - $idartlangs[] = $db->f("idartlang"); - } - } - } - - $workflowArtAllocation = new WorkflowArtAllocation; - $workflowArtAllocations = new WorkflowArtAllocations; - - foreach ($idartlangs as $idartlang) - { - $workflowArtAllocation->loadBy("idartlang", $idartlang); - $workflowArtAllocations->delete($workflowArtAllocation->get("idartallocation")); - } + $idcatlang = $obj->get("idcatlang"); + + $db = new DB_ConLite; + $sql = "SELECT idcat FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcatlang = '" . Contenido_Security::toInteger($idcatlang) . "'"; + $db->query($sql); + $db->next_record(); + $idcat = $db->f("idcat"); + + $sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat = '" . Contenido_Security::toInteger($idcat) . "'"; + $db->query($sql); + + while ($db->next_record()) { + $idarts[] = $db->f("idart"); + } + + $idartlangs = array(); + + if (is_array($idarts)) { + foreach ($idarts as $idart) { + $sql = "SELECT idartlang FROM " . $cfg["tab"]["art_lang"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "' and idlang = '" . Contenido_Security::toInteger($lang) . "'"; + $db->query($sql); + if ($db->next_record()) { + $idartlangs[] = $db->f("idartlang"); + } + } + } + + $workflowArtAllocation = new WorkflowArtAllocation; + $workflowArtAllocations = new WorkflowArtAllocations; + + foreach ($idartlangs as $idartlang) { + $workflowArtAllocation->loadBy("idartlang", $idartlang); + $workflowArtAllocations->delete($workflowArtAllocation->get("idartallocation")); + } + + parent::delete($idallocation); + } + + function create($idworkflow, $idcatlang) { + $this->select("idcatlang = '$idcatlang'"); + + if ($this->next() !== false) { + $this->lasterror = i18n("Category already has a workflow assigned", "workflow"); + return false; + } + + $workflows = new Workflows; + $workflows->select("idworkflow = '$idworkflow'"); + + if ($workflows->next() === false) { + $this->lasterror = i18n("Workflow doesn't exist", "workflow"); + return false; + } + $newitem = parent::createNewItem(); + if (!$newitem->setWorkflow($idworkflow)) { + $this->lasterror = $newitem->lasterror; + $workflows->delete($newitem->getField("idallocation")); + return false; + } + + if (!$newitem->setCatLang($idcatlang)) { + $this->lasterror = $newitem->lasterror; + $workflows->delete($newitem->getField("idallocation")); + return false; + } + + $newitem->store(); + + return ($newitem); + } - parent::delete($idallocation); - } - - function create ($idworkflow, $idcatlang) - { - $this->select("idcatlang = '$idcatlang'"); - - if ($this->next() !== false) - { - $this->lasterror = i18n("Category already has a workflow assigned", "workflow"); - return false; - } - - $workflows = new Workflows; - $workflows->select("idworkflow = '$idworkflow'"); - - if ($workflows->next() === false) - { - $this->lasterror = i18n("Workflow doesn't exist", "workflow"); - return false; - } - $newitem = parent::createNewItem(); - if (!$newitem->setWorkflow($idworkflow)) - { - $this->lasterror = $newitem->lasterror; - $workflows->delete($newitem->getField("idallocation")); - return false; - } - - if (!$newitem->setCatLang($idcatlang)) - { - $this->lasterror = $newitem->lasterror; - $workflows->delete($newitem->getField("idallocation")); - return false; - } - - $newitem->store(); - - return ($newitem); - } } /** @@ -155,88 +142,82 @@ class WorkflowAllocations extends ItemCollection { * @copyright four for business 2003 */ class WorkflowAllocation extends Item { - - /** + + /** * Constructor Function * @param string $table The table to use as information source */ - function __construct() - { - global $cfg; - - parent::__construct($cfg["tab"]["workflow_allocation"], "idallocation"); - } + function __construct() { + global $cfg; + + parent::__construct($cfg["tab"]["workflow_allocation"], "idallocation"); + } /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - function WorkflowAllocation() - { + function WorkflowAllocation() { cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); $this->__construct(); } - /** + /** * Overridden setField function. Users should only use setWorkflow. * @param string $field Void field since we override the usual setField function * @param string $value Void field since we override the usual setField function - */ - function setField($field, $value, $bSafe = true) - { - die("Don't use setField for WorkflowAllocation items! Use setWorkflow instead!"); - } - - /** + */ + function setField($field, $value, $bSafe = true) { + die("Don't use setField for WorkflowAllocation items! Use setWorkflow instead!"); + } + + /** * setWorkflow sets the workflow for the current item. * @param int $idworkflow Workflow-ID to set the item to - */ - function setWorkflow ($idworkflow) - { - $workflows = new Workflows; + */ + function setWorkflow($idworkflow) { + $workflows = new Workflows; - $workflows->select("idworkflow = '$idworkflow'"); - - if ($workflows->next() === false) - { - $this->lasterror = i18n("Workflow doesn't exist", "workflow"); - return false; - } - - parent::setField("idworkflow", $idworkflow); - parent::store(); - return true; - } + $workflows->select("idworkflow = '$idworkflow'"); - /** + if ($workflows->next() === false) { + $this->lasterror = i18n("Workflow doesn't exist", "workflow"); + return false; + } + + parent::setField("idworkflow", $idworkflow); + parent::store(); + return true; + } + + /** * setCatLang sets the idcatlang for the current item. Should - * only be called by the create function. + * only be called by the create function. * @param int $idcatlang idcatlang to set. - */ - function setCatLang ($idcatlang) - { - global $cfg; - - $allocations = new WorkflowAllocations; - - $allocations->select("idcatlang = '$idcatlang'"); - - if ($allocations->next() !== false) - { - $this->lasterror = i18n("Category already has a workflow assigned", "workflow"); - return false; - } - - $db = new DB_ConLite; - $sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcatlang = '".Contenido_Security::toInteger($idcatlang)."'"; - $db->query($sql); - - if (!$db->next_record()) - { - $this->lasterror = i18n("Category doesn't exist, assignment failed", "workflow"); - return false; - } + */ + function setCatLang($idcatlang) { + global $cfg; + + $allocations = new WorkflowAllocations; + + $allocations->select("idcatlang = '$idcatlang'"); + + if ($allocations->next() !== false) { + $this->lasterror = i18n("Category already has a workflow assigned", "workflow"); + return false; + } + + $db = new DB_ConLite; + $sql = "SELECT idcatlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcatlang = '" . Contenido_Security::toInteger($idcatlang) . "'"; + $db->query($sql); + + if (!$db->next_record()) { + $this->lasterror = i18n("Category doesn't exist, assignment failed", "workflow"); + return false; + } + + parent::setField("idcatlang", $idcatlang); + parent::store(); + return true; + } - parent::setField("idcatlang", $idcatlang); - parent::store(); - return true; - } } + ?> \ No newline at end of file diff --git a/classes/class.workflowartallocation.php b/classes/class.workflowartallocation.php index 8774e85..811b013 100644 --- a/classes/class.workflowartallocation.php +++ b/classes/class.workflowartallocation.php @@ -1,4 +1,5 @@ _setItemClass("WorkflowArtAllocation"); - } - + } + /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - function WorkflowArtAllocations() - { + function WorkflowArtAllocations() { cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); $this->__construct(); } - function create ($idartlang) - { - global $cfg; - - $sql = "SELECT idartlang FROM " .$cfg["tab"]["art_lang"]. - " WHERE idartlang = '".Contenido_Security::escapeDB($idartlang, $this->db)."'"; + function create($idartlang) { + global $cfg; + + $sql = "SELECT idartlang FROM " . $cfg["tab"]["art_lang"] . + " WHERE idartlang = '" . Contenido_Security::escapeDB($idartlang, $this->db) . "'"; + + $this->db->query($sql); + if (!$this->db->next_record()) { + $this->lasterror = i18n("Article doesn't exist", "workflow"); + return false; + } + + $this->select("idartlang = '$idartlang'"); + + if ($this->next() !== false) { + $this->lasterror = i18n("Article is already assigned to a usersequence step.", "workflow"); + return false; + } + + $newitem = parent::createNewItem(); + $newitem->setField("idartlang", $idartlang); + $newitem->store(); + + return ($newitem); + } - $this->db->query($sql); - if (!$this->db->next_record()) - { - $this->lasterror = i18n("Article doesn't exist", "workflow"); - return false; - } - - $this->select("idartlang = '$idartlang'"); - - if ($this->next() !== false) - { - $this->lasterror = i18n("Article is already assigned to a usersequence step.", "workflow"); - return false; - } - - $newitem = parent::createNewItem(); - $newitem->setField("idartlang",$idartlang); - $newitem->store(); - - return ($newitem); - } } /** @@ -97,265 +92,241 @@ class WorkflowArtAllocations extends ItemCollection { * @copyright four for business 2003 */ class WorkflowArtAllocation extends Item { - - /** + + /** * Constructor Function * @param string $table The table to use as information source */ - function __construct() - { - global $cfg; - - parent::__construct($cfg["tab"]["workflow_art_allocation"], "idartallocation"); - } + function __construct() { + global $cfg; + + parent::__construct($cfg["tab"]["workflow_art_allocation"], "idartallocation"); + } /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - function WorkflowArtAllocation() - { + function WorkflowArtAllocation() { cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); $this->__construct(); } - function getWorkflowItem () - { - $userSequence = new WorkflowUserSequence; - $userSequence->loadByPrimaryKey($this->values["idusersequence"]); - - return ($userSequence->getWorkflowItem()); - } - - /** + function getWorkflowItem() { + $userSequence = new WorkflowUserSequence; + $userSequence->loadByPrimaryKey($this->values["idusersequence"]); + + return ($userSequence->getWorkflowItem()); + } + + /** * Returns the current item position * @param string $field Void field since we override the usual setField function * @param string $value Void field since we override the usual setField function - */ - function currentItemPosition() - { - $idworkflowitem = $this->get("idworkflowitem"); - - $workflowItems = new WorkflowItems; - $workflowItems->select("idworkflowitem = '$idworkflowitem'"); - - if ($item = $workflowItems->next()) - { - return ($item->get("position")); - } - } + */ + function currentItemPosition() { + $idworkflowitem = $this->get("idworkflowitem"); - /** + $workflowItems = new WorkflowItems; + $workflowItems->select("idworkflowitem = '$idworkflowitem'"); + + if ($item = $workflowItems->next()) { + return ($item->get("position")); + } + } + + /** * Returns the current user position * @param string $field Void field since we override the usual setField function * @param string $value Void field since we override the usual setField function - */ - function currentUserPosition() - { - return ($this->get("position")); - } + */ + function currentUserPosition() { + return ($this->get("position")); + } - /** + /** * Overriden store function to send mails * @param none - */ - function store() - { - global $cfg; - - $sMailhost = getSystemProperty('system', 'mail_host'); + */ + function store() { + global $cfg; + + $sMailhost = getSystemProperty('system', 'mail_host'); if ($sMailhost == '') { $sMailhost = 'localhost'; - } - - //modified : 2008-06-25 - use php mailer class instead of mail() - $oMail = new PHPMailer(); + } + + //modified : 2008-06-25 - use php mailer class instead of mail() + $oMail = new PHPMailer(); $oMail->Host = $sMailhost; $oMail->IsHTML(0); - $oMail->WordWrap = 1000; - $oMail->IsMail(); - - if (array_key_exists("idusersequence",$this->modifiedValues)) - { - $usersequence = new WorkflowUserSequence; - $usersequence->loadByPrimaryKey($this->values["idusersequence"]); - - $email = $usersequence->get("emailnoti"); - $escal = $usersequence->get("escalationnoti"); - - if ($email == 1 || $escal == 1) - { - /* Grab the required informations */ - $curEditor = getGroupOrUserName($usersequence->get("iduser")); - $idartlang = $this->get("idartlang"); - $timeunit = $usersequence->get("timeunit"); - $timelimit = $usersequence->get("timelimit"); - - $db = new DB_ConLite; - $sql = "SELECT author, title, idart FROM ".$cfg["tab"]["art_lang"]." WHERE idartlang = '".Contenido_Security::escapeDB($idartlang, $db)."'"; - - $db->query($sql); - - if ($db->next_record()) - { - $idart = $db->f("idart"); - $title = $db->f("title"); - $author = $db->f("author"); - } - - /* Extract category */ - $sql = "SELECT idcat FROM ".$cfg["tab"]["cat_art"]." WHERE idart = '".Contenido_Security::escapeDB($idart, $db)."'"; - $db->query($sql); - - if ($db->next_record()) - { - $idcat = $db->f("idcat"); - } - - $sql = "SELECT name FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat = '".Contenido_Security::escapeDB($idcat, $db)."'"; - $db->query($sql); - - if ($db->next_record()) - { - $catname = $db->f("name"); - } - - $starttime = $this->get("starttime"); - - - $starttime = strtotime (substr_replace (substr (substr ($starttime,0,2).chunk_split (substr ($starttime,2,6),2,"-").chunk_split (substr ($starttime,8),2,":"),0,19)," ",10,1)); - - switch ($timeunit) - { - case "Seconds": - $maxtime = $starttime + $timelimit; - break; - case "Minutes": - $maxtime = $starttime + ($timelimit * 60); - break; - case "Hours": - $maxtime = $starttime + ($timelimit * 3600); - break; - case "Days": - $maxtime = $starttime + ($timelimit * 86400); - break; - case "Weeks": - $maxtime = $starttime + ($timelimit * 604800); - break; - case "Months": - $maxtime = $starttime + ($timelimit * 2678400); - break; - case "Years": - $maxtime = $starttime + ($timelimit * 31536000); - break; - default: - $maxtime = $starttime + $timelimit; - } - - if ($email == 1) - { - $email = "Hello %s,\n\n". - "you are assigned as the next editor for the Article %s.\n\n". - "More informations:\n". - "Article: %s\n". - "Category: %s\n". - "Editor: %s\n". - "Author: %s\n". - "Editable from: %s\n". - "Editable to: %s\n"; - - $filledMail = sprintf( $email, - $curEditor, - $title, - $title, - $catname, - $curEditor, - $author, - date("Y-m-d H:i:s", $starttime), - date("Y-m-d H:i:s", $maxtime)); - $user = new User; + $oMail->WordWrap = 1000; + $oMail->IsMail(); - if (isGroup($usersequence->get("iduser"))) - { - $sql = "select idgroupuser, user_id FROM ". $cfg["tab"]["groupmembers"] ." WHERE - group_id = '".Contenido_Security::escapeDB($usersequence->get("iduser"), $db)."'"; - $db->query($sql); - - while ($db->next_record()) - { - $user->loadUserByUserID($db->f("user_id")); - //modified : 2008-06-25 - use php mailer class instead of mail() - $oMail->AddAddress($user->getField("email"), ""); - $oMail->Subject = stripslashes (i18n('Workflow notification')); - $oMail->Body = $filledMail; - $oMail->Send(); - } - - } else { - $user->loadUserByUserID($usersequence->get("iduser")); - //modified : 2008-06-25 - use php mailer class instead of mail() - $oMail->AddAddress($user->getField("email"), ""); - $oMail->Subject = stripslashes (i18n('Workflow notification')); - $oMail->Body = $filledMail; - $oMail->Send(); - } - - } else { - $email = "Hello %s,\n\n". - "you are assigned as the escalator for the Article %s.\n\n". - "More informations:\n". - "Article: %s\n". - "Category: %s\n". - "Editor: %s\n". - "Author: %s\n". - "Editable from: %s\n". - "Editable to: %s\n"; - - $filledMail = sprintf( $email, - $curEditor, - $title, - $title, - $catname, - $curEditor, - $author, - date("Y-m-d H:i:s", $starttime), - date("Y-m-d H:i:s", $maxtime)); - - $user = new User; - - if (isGroup($usersequence->get("iduser"))) - { - - $sql = "select idgroupuser, user_id FROM ". $cfg["tab"]["groupmembers"] ." WHERE - group_id = '".Contenido_Security::escapeDB($usersequence->get("iduser"), $db)."'"; - $db->query($sql); - - while ($db->next_record()) - { - $user->loadUserByUserID($db->f("user_id")); - echo "mail to ".$user->getField("email")."
"; - //modified : 2008-06-25 - use php mailer class instead of mail() - $oMail->AddAddress($user->getField("email"), ""); - $oMail->Subject = stripslashes (i18n('Workflow escalation')); - $oMail->Body = $filledMail; - $oMail->Send(); - } - - } else { - $user->loadUserByUserID($usersequence->get("iduser")); - echo "mail to ".$user->getField("email")."
"; - //modified : 2008-06-25 - use php mailer class instead of mail() - $oMail->AddAddress($user->getField("email"), ""); - $oMail->Subject = stripslashes (i18n('Workflow escalation')); - $oMail->Body = $filledMail; - $oMail->Send(); - } - } - + if (array_key_exists("idusersequence", $this->modifiedValues)) { + $usersequence = new WorkflowUserSequence; + $usersequence->loadByPrimaryKey($this->values["idusersequence"]); + + $email = $usersequence->get("emailnoti"); + $escal = $usersequence->get("escalationnoti"); + + if ($email == 1 || $escal == 1) { + /* Grab the required informations */ + $curEditor = getGroupOrUserName($usersequence->get("iduser")); + $idartlang = $this->get("idartlang"); + $timeunit = $usersequence->get("timeunit"); + $timelimit = $usersequence->get("timelimit"); + + $db = new DB_ConLite; + $sql = "SELECT author, title, idart FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang = '" . Contenido_Security::escapeDB($idartlang, $db) . "'"; + + $db->query($sql); + + if ($db->next_record()) { + $idart = $db->f("idart"); + $title = $db->f("title"); + $author = $db->f("author"); + } + + /* Extract category */ + $sql = "SELECT idcat FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::escapeDB($idart, $db) . "'"; + $db->query($sql); + + if ($db->next_record()) { + $idcat = $db->f("idcat"); + } + + $sql = "SELECT name FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat = '" . Contenido_Security::escapeDB($idcat, $db) . "'"; + $db->query($sql); + + if ($db->next_record()) { + $catname = $db->f("name"); + } + + $starttime = $this->get("starttime"); + + + $starttime = strtotime(substr_replace(substr(substr($starttime, 0, 2) . chunk_split(substr($starttime, 2, 6), 2, "-") . chunk_split(substr($starttime, 8), 2, ":"), 0, 19), " ", 10, 1)); + + switch ($timeunit) { + case "Seconds": + $maxtime = $starttime + $timelimit; + break; + case "Minutes": + $maxtime = $starttime + ($timelimit * 60); + break; + case "Hours": + $maxtime = $starttime + ($timelimit * 3600); + break; + case "Days": + $maxtime = $starttime + ($timelimit * 86400); + break; + case "Weeks": + $maxtime = $starttime + ($timelimit * 604800); + break; + case "Months": + $maxtime = $starttime + ($timelimit * 2678400); + break; + case "Years": + $maxtime = $starttime + ($timelimit * 31536000); + break; + default: + $maxtime = $starttime + $timelimit; + } + + if ($email == 1) { + $email = "Hello %s,\n\n" . + "you are assigned as the next editor for the Article %s.\n\n" . + "More informations:\n" . + "Article: %s\n" . + "Category: %s\n" . + "Editor: %s\n" . + "Author: %s\n" . + "Editable from: %s\n" . + "Editable to: %s\n"; + + $filledMail = sprintf($email, + $curEditor, + $title, + $title, + $catname, + $curEditor, + $author, + date("Y-m-d H:i:s", $starttime), + date("Y-m-d H:i:s", $maxtime)); + $user = new User; + + if (isGroup($usersequence->get("iduser"))) { + $sql = "select idgroupuser, user_id FROM " . $cfg["tab"]["groupmembers"] . " WHERE + group_id = '" . Contenido_Security::escapeDB($usersequence->get("iduser"), $db) . "'"; + $db->query($sql); + + while ($db->next_record()) { + $user->loadUserByUserID($db->f("user_id")); + //modified : 2008-06-25 - use php mailer class instead of mail() + $oMail->AddAddress($user->getField("email"), ""); + $oMail->Subject = stripslashes(i18n('Workflow notification')); + $oMail->Body = $filledMail; + $oMail->Send(); + } + } else { + $user->loadUserByUserID($usersequence->get("iduser")); + //modified : 2008-06-25 - use php mailer class instead of mail() + $oMail->AddAddress($user->getField("email"), ""); + $oMail->Subject = stripslashes(i18n('Workflow notification')); + $oMail->Body = $filledMail; + $oMail->Send(); + } + } else { + $email = "Hello %s,\n\n" . + "you are assigned as the escalator for the Article %s.\n\n" . + "More informations:\n" . + "Article: %s\n" . + "Category: %s\n" . + "Editor: %s\n" . + "Author: %s\n" . + "Editable from: %s\n" . + "Editable to: %s\n"; + + $filledMail = sprintf($email, + $curEditor, + $title, + $title, + $catname, + $curEditor, + $author, + date("Y-m-d H:i:s", $starttime), + date("Y-m-d H:i:s", $maxtime)); + + $user = new User; + + if (isGroup($usersequence->get("iduser"))) { + + $sql = "select idgroupuser, user_id FROM " . $cfg["tab"]["groupmembers"] . " WHERE + group_id = '" . Contenido_Security::escapeDB($usersequence->get("iduser"), $db) . "'"; + $db->query($sql); + + while ($db->next_record()) { + $user->loadUserByUserID($db->f("user_id")); + echo "mail to " . $user->getField("email") . "
"; + //modified : 2008-06-25 - use php mailer class instead of mail() + $oMail->AddAddress($user->getField("email"), ""); + $oMail->Subject = stripslashes(i18n('Workflow escalation')); + $oMail->Body = $filledMail; + $oMail->Send(); + } + } else { + $user->loadUserByUserID($usersequence->get("iduser")); + echo "mail to " . $user->getField("email") . "
"; + //modified : 2008-06-25 - use php mailer class instead of mail() + $oMail->AddAddress($user->getField("email"), ""); + $oMail->Subject = stripslashes(i18n('Workflow escalation')); + $oMail->Body = $filledMail; + $oMail->Send(); + } + } + } + } + return parent::store(); + } - - } - - - } - return parent::store(); - } } + ?> \ No newline at end of file diff --git a/classes/class.workflowtasks.php b/classes/class.workflowtasks.php index 008b9a3..c0aeda1 100644 --- a/classes/class.workflowtasks.php +++ b/classes/class.workflowtasks.php @@ -1,4 +1,5 @@ _setItemClass("WorkflowTask"); - } - + } + /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - function WorkflowTasks() - { + function WorkflowTasks() { cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); $this->__construct(); } - function create () - { - $newitem = parent::createNewItem(); - return ($newitem); - } - - function select ($where = "", $group_by = "", $order_by = "", $limit = "") - { - global $client; - - if ($where != "") - { - $where = $where . " AND idclient = '".Contenido_Security::escapeDB($client, NULL)."'"; - } - return parent::select($where, $group_by, $order_by, $limit); - } + function create() { + $newitem = parent::createNewItem(); + return ($newitem); + } + + function select($where = "", $group_by = "", $order_by = "", $limit = "") { + global $client; + + if ($where != "") { + $where = $where . " AND idclient = '" . Contenido_Security::escapeDB($client, NULL) . "'"; + } + return parent::select($where, $group_by, $order_by, $limit); + } + } /** @@ -84,23 +79,22 @@ class WorkflowTasks extends ItemCollection { * @copyright four for business 2003 */ class WorkflowTask extends Item { - - /** + + /** * Constructor Function * @param string $table The table to use as information source */ - function __construct() - { - global $cfg; - parent::__construct($cfg["tab"]["tasks"], "idtask"); - } + function __construct() { + global $cfg; + parent::__construct($cfg["tab"]["tasks"], "idtask"); + } /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - function WorkflowTask() - { + function WorkflowTask() { cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); $this->__construct(); } + } ?> \ No newline at end of file diff --git a/classes/class.workflowusersequence.php b/classes/class.workflowusersequence.php index 2a5a0a7..9f13636 100644 --- a/classes/class.workflowusersequence.php +++ b/classes/class.workflowusersequence.php @@ -1,4 +1,5 @@ _setItemClass("WorkflowUserSequence"); - } - + } + /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - function WorkflowUserSequences() - { + function WorkflowUserSequences() { cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); $this->__construct(); } - function delete ($id) - { + function delete($id) { global $cfg, $idworkflow; - - $item = new WorkflowUserSequence; - $item->loadByPrimaryKey($id); - - $pos = $item->get("position"); - $idworkflowitem = $item->get("idworkflowitem"); - $this->select("position > $pos AND idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."'"); - while ($obj = $this->next()) - { - $pos = $obj->get("position") -1; - $obj->setPosition($pos); - $obj->store(); - } + + $item = new WorkflowUserSequence; + $item->loadByPrimaryKey($id); + + $pos = $item->get("position"); + $idworkflowitem = $item->get("idworkflowitem"); + $this->select("position > $pos AND idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "'"); + while ($obj = $this->next()) { + $pos = $obj->get("position") - 1; + $obj->setPosition($pos); + $obj->store(); + } parent::delete($id); - + $this->updateArtAllocation($id); - } - - function updateArtAllocation ($idusersequence) { + } + + function updateArtAllocation($idusersequence) { global $idworkflow, $cfg; $oDb = new DB_ConLite(); - + $aIdArtLang = array(); - $sSql = 'SELECT idartlang FROM '.$cfg["tab"]["workflow_art_allocation"].' WHERE idusersequence = '.Contenido_Security::escapeDB($idusersequence, $oDb).';'; + $sSql = 'SELECT idartlang FROM ' . $cfg["tab"]["workflow_art_allocation"] . ' WHERE idusersequence = ' . Contenido_Security::escapeDB($idusersequence, $oDb) . ';'; $oDb->query($sSql); while ($oDb->next_record()) { array_push($aIdArtLang, $oDb->f('idartlang')); } - - $sSql = 'DELETE FROM '.$cfg["tab"]["workflow_art_allocation"].' WHERE idusersequence = '.Contenido_Security::escapeDB($idusersequence, $oDb).';'; + + $sSql = 'DELETE FROM ' . $cfg["tab"]["workflow_art_allocation"] . ' WHERE idusersequence = ' . Contenido_Security::escapeDB($idusersequence, $oDb) . ';'; $oDb->query($sSql); - - + + foreach ($aIdArtLang as $iIdArtLang) { setUserSequence($iIdArtLang, $idworkflow); - } + } } - - function create ($idworkflowitem) - { - global $auth, $client, $idworkflow; - $newitem = parent::createNewItem(); - - $workflowitems = new WorkflowItems; - if (!$workflowitems->exists($idworkflowitem)) - { - $this->delete($newitem->getField("idusersequence")); - $this->lasterror = i18n("Workflow item doesn't exist. Can't create entry.", "workflow"); - return false; - } - - $this->select("idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."'","","position DESC","1"); - - $item = $this->next(); - - if ($item === false) - { - $lastPos = 1; - } else { - $lastPos = $item->getField("position") + 1; - } - - $newitem->setWorkflowItem($idworkflowitem); - $newitem->setPosition($lastPos); - $newitem->store(); - - return ($newitem); - } - - function swap ($idworkflowitem, $pos1, $pos2) - { - $this->select("idworkflowitem = '$idworkflowitem' AND position = '".Contenido_Security::escapeDB($pos1, NULL)."'"); - if (($item = $this->next()) === false) - { - $this->lasterror = i18n("Swapping items failed: Item doesn't exist", "workflow"); - return false; - } - - $pos1ID = $item->getField("idusersequence"); - $this->select("idworkflowitem = '$idworkflowitem' AND position = '".Contenido_Security::escapeDB($pos2, NULL)."'"); - if (($item = $this->next()) === false) - { - $this->lasterror(i18n("Swapping items failed: Item doesn't exist", "workflow")); - return false; - } - - $pos2ID = $item->getField("idusersequence"); - - $item = new WorkflowUserSequence(); - $item->loadByPrimaryKey($pos1ID); - $item->setPosition($pos2); - $item->store(); - $item->loadByPrimaryKey($pos2ID); - $item->setPosition($pos1); - $item->store(); - + function create($idworkflowitem) { + global $auth, $client, $idworkflow; + $newitem = parent::createNewItem(); + + $workflowitems = new WorkflowItems; + if (!$workflowitems->exists($idworkflowitem)) { + $this->delete($newitem->getField("idusersequence")); + $this->lasterror = i18n("Workflow item doesn't exist. Can't create entry.", "workflow"); + return false; + } + + $this->select("idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "'", "", "position DESC", "1"); + + $item = $this->next(); + + if ($item === false) { + $lastPos = 1; + } else { + $lastPos = $item->getField("position") + 1; + } + + $newitem->setWorkflowItem($idworkflowitem); + $newitem->setPosition($lastPos); + $newitem->store(); + + return ($newitem); + } + + function swap($idworkflowitem, $pos1, $pos2) { + $this->select("idworkflowitem = '$idworkflowitem' AND position = '" . Contenido_Security::escapeDB($pos1, NULL) . "'"); + if (($item = $this->next()) === false) { + $this->lasterror = i18n("Swapping items failed: Item doesn't exist", "workflow"); + return false; + } + + $pos1ID = $item->getField("idusersequence"); + + $this->select("idworkflowitem = '$idworkflowitem' AND position = '" . Contenido_Security::escapeDB($pos2, NULL) . "'"); + if (($item = $this->next()) === false) { + $this->lasterror(i18n("Swapping items failed: Item doesn't exist", "workflow")); + return false; + } + + $pos2ID = $item->getField("idusersequence"); + + $item = new WorkflowUserSequence(); + $item->loadByPrimaryKey($pos1ID); + $item->setPosition($pos2); + $item->store(); + $item->loadByPrimaryKey($pos2ID); + $item->setPosition($pos1); + $item->store(); + $this->updateArtAllocation($pos2ID); $this->updateArtAllocation($pos1ID); - - return (true); - } + + return (true); + } + } /** @@ -174,105 +164,95 @@ class WorkflowUserSequences extends ItemCollection { * @copyright four for business 2003 */ class WorkflowUserSequence extends Item { - - /** + + /** * Constructor Function * @param string $table The table to use as information source */ - function __construct() - { - global $cfg; - parent::__construct($cfg["tab"]["workflow_user_sequences"], "idusersequence"); - } - + function __construct() { + global $cfg; + parent::__construct($cfg["tab"]["workflow_user_sequences"], "idusersequence"); + } + /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ - function WorkflowUserSequence() - { + function WorkflowUserSequence() { cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); $this->__construct(); } - /** + /** * Override setField Function to prevent that somebody modifies - * idsequence. + * idsequence. * @param string $field Field to set * @param string $valie Value to set */ - function setField($field, $value, $bSafe = true) - { - global $cfg; - - switch ($field) - { - case "idworkflowitem": - die("Please use create to modify idsequence. Direct modifications are not allowed"); - case "idusersequence": - die("Please use create to modify idsequence. Direct modifications are not allowed"); - case "position": - die("Please use create and swap to set the position. Direct modifications are not allowed"); - case "iduser": - if ($value != 0) - { - $db = new DB_ConLite; - $sql = "SELECT user_id FROM " . $cfg["tab"]["phplib_auth_user_md5"] . - " WHERE user_id = '".Contenido_Security::escapeDB($value, $db)."'"; - $db->query($sql); - - if (!$db->next_record()) - { - $sql = "SELECT group_id FROM " . $cfg["tab"]["groups"] . - " WHERE group_id = '".Contenido_Security::escapeDB($value, $db)."'"; - - $db->query($sql); - if (!$db->next_record()) - { - $this->lasterror = i18n("Can't set user_id: User or group doesn't exist", "workflow"); - return false; - } - } - $idusersquence = parent::getField('idusersequence'); - } + function setField($field, $value, $bSafe = true) { + global $cfg; - } - - parent::setField($field, $value, $bSafe); + switch ($field) { + case "idworkflowitem": + die("Please use create to modify idsequence. Direct modifications are not allowed"); + case "idusersequence": + die("Please use create to modify idsequence. Direct modifications are not allowed"); + case "position": + die("Please use create and swap to set the position. Direct modifications are not allowed"); + case "iduser": + if ($value != 0) { + $db = new DB_ConLite; + $sql = "SELECT user_id FROM " . $cfg["tab"]["phplib_auth_user_md5"] . + " WHERE user_id = '" . Contenido_Security::escapeDB($value, $db) . "'"; + $db->query($sql); + + if (!$db->next_record()) { + $sql = "SELECT group_id FROM " . $cfg["tab"]["groups"] . + " WHERE group_id = '" . Contenido_Security::escapeDB($value, $db) . "'"; + + $db->query($sql); + if (!$db->next_record()) { + $this->lasterror = i18n("Can't set user_id: User or group doesn't exist", "workflow"); + return false; + } + } + $idusersquence = parent::getField('idusersequence'); + } + } + + parent::setField($field, $value, $bSafe); if ($idusersquence) { WorkflowUserSequences::updateArtAllocation(0); } - } + } - /** + /** * Returns the associated workflowItem for this user sequence * @param none */ - function getWorkflowItem () - { - if (!$this->virgin) - { - $workflowItem = new WorkflowItem; - $workflowItem->loadByPrimaryKey($this->values["idworkflowitem"]); - return ($workflowItem); - } else { - return false; - } - } - - /** - * Interface to set idworkflowitem. Should only be called by "create". - * @param string $value The value to set - */ - function setWorkflowItem($value) - { - parent::setField("idworkflowitem", $value); - } + function getWorkflowItem() { + if (!$this->virgin) { + $workflowItem = new WorkflowItem; + $workflowItem->loadByPrimaryKey($this->values["idworkflowitem"]); + return ($workflowItem); + } else { + return false; + } + } - /** + /** * Interface to set idworkflowitem. Should only be called by "create". * @param string $value The value to set */ - function setPosition($value) - { - parent::setField("position", $value); - } + function setWorkflowItem($value) { + parent::setField("idworkflowitem", $value); + } + + /** + * Interface to set idworkflowitem. Should only be called by "create". + * @param string $value The value to set + */ + function setPosition($value) { + parent::setField("position", $value); + } + } + ?> \ No newline at end of file diff --git a/cronjobs/advance_workflow.php b/cronjobs/advance_workflow.php index c4304ce..7669682 100644 --- a/cronjobs/advance_workflow.php +++ b/cronjobs/advance_workflow.php @@ -1,4 +1,5 @@ select(); -while ($obj = $workflowartallocations->next()) -{ - $starttime = $obj->get("starttime"); - $idartlang = $obj->get("idartlang"); - $lastidusersequence = $obj->get("lastusersequence"); - - $usersequence = getCurrentUserSequence($idartlang,0); - - if ($usersequence != $lastidusersequence) - { - - $workflowusersequences->select("idusersequence = '$usersequence'"); - - if ($wfobj = $workflowusersequences->next()) - { - $wfitem = $wfobj->get("idworkflowitem"); - $pos = $wfobj->get("position"); - $timeunit = $wfobj->get("timeunit"); - $timelimit = $wfobj->get("timelimit"); - } - - $starttime = strtotime (substr_replace (substr (substr ($starttime,0,2).chunk_split (substr ($starttime,2,6),2,"-").chunk_split (substr ($starttime,8),2,":"),0,19)," ",10,1)); - switch ($timeunit) - { - case "Seconds": - $maxtime = $starttime + $timelimit; - break; - case "Minutes": - $maxtime = $starttime + ($timelimit * 60); - break; - case "Hours": - $maxtime = $starttime + ($timelimit * 3600); - break; - case "Days": - $maxtime = $starttime + ($timelimit * 86400); - break; - case "Weeks": - $maxtime = $starttime + ($timelimit * 604800); - break; - case "Months": - $maxtime = $starttime + ($timelimit * 2678400); - break; - case "Years": - $maxtime = $starttime + ($timelimit * 31536000); - break; - default: - $maxtime = $starttime + $timelimit; - } - - - - if ($maxtime < time()) - { - $pos = $pos + 1; - $workflowusersequences->select("idworkflowitem = '$wfitem' AND position = '".Contenido_Security::escapeDB($pos, NULL)."'"); - - if ($wfobj = $workflowusersequences->next()) - { - $obj->set("idusersequence", $wfobj->get("idusersequence")); - $obj->store(); - - } - } - - } -} +while ($obj = $workflowartallocations->next()) { + $starttime = $obj->get("starttime"); + $idartlang = $obj->get("idartlang"); + $lastidusersequence = $obj->get("lastusersequence"); + $usersequence = getCurrentUserSequence($idartlang, 0); + + if ($usersequence != $lastidusersequence) { + + $workflowusersequences->select("idusersequence = '$usersequence'"); + + if ($wfobj = $workflowusersequences->next()) { + $wfitem = $wfobj->get("idworkflowitem"); + $pos = $wfobj->get("position"); + $timeunit = $wfobj->get("timeunit"); + $timelimit = $wfobj->get("timelimit"); + } + + $starttime = strtotime(substr_replace(substr(substr($starttime, 0, 2) . chunk_split(substr($starttime, 2, 6), 2, "-") . chunk_split(substr($starttime, 8), 2, ":"), 0, 19), " ", 10, 1)); + switch ($timeunit) { + case "Seconds": + $maxtime = $starttime + $timelimit; + break; + case "Minutes": + $maxtime = $starttime + ($timelimit * 60); + break; + case "Hours": + $maxtime = $starttime + ($timelimit * 3600); + break; + case "Days": + $maxtime = $starttime + ($timelimit * 86400); + break; + case "Weeks": + $maxtime = $starttime + ($timelimit * 604800); + break; + case "Months": + $maxtime = $starttime + ($timelimit * 2678400); + break; + case "Years": + $maxtime = $starttime + ($timelimit * 31536000); + break; + default: + $maxtime = $starttime + $timelimit; + } + + + + if ($maxtime < time()) { + $pos = $pos + 1; + $workflowusersequences->select("idworkflowitem = '$wfitem' AND position = '" . Contenido_Security::escapeDB($pos, NULL) . "'"); + + if ($wfobj = $workflowusersequences->next()) { + $obj->set("idusersequence", $wfobj->get("idusersequence")); + $obj->store(); + } + } + } +} ?> diff --git a/includes/config.autoloader.php b/includes/config.autoloader.php new file mode 100644 index 0000000..b8d5f11 --- /dev/null +++ b/includes/config.autoloader.php @@ -0,0 +1,19 @@ + $sAutoloadClassPath.'class.workflow.php', + 'Workflows' => $sAutoloadClassPath.'class.workflow.php', + 'WorkflowAction' => $sAutoloadClassPath.'class.workflowactions.php', + 'WorkflowActions' => $sAutoloadClassPath.'class.workflowactions.php', + 'WorkflowAllocation' => $sAutoloadClassPath.'class.workflowallocation.php', + 'WorkflowAllocations' => $sAutoloadClassPath.'class.workflowallocation.php', + 'WorkflowArtAllocation' => $sAutoloadClassPath.'class.workflowartallocation.php', + 'WorkflowArtAllocations' => $sAutoloadClassPath.'class.workflowartallocation.php', + 'WorkflowItem' => $sAutoloadClassPath.'class.workflowitems.php', + 'WorkflowItems' => $sAutoloadClassPath.'class.workflowitems.php', + 'WorkflowTask' => $sAutoloadClassPath.'class.workflowtasks.php', + 'WorkflowTasks' => $sAutoloadClassPath.'class.workflowtasks.php', + 'WorkflowUserSequence' => $sAutoloadClassPath.'class.workflowusersequence.php', + 'WorkflowUserSequences' => $sAutoloadClassPath.'class.workflowusersequence.php' +); +?> \ No newline at end of file diff --git a/includes/config.plugin.php b/includes/config.plugin.php index e89f864..462cb24 100644 --- a/includes/config.plugin.php +++ b/includes/config.plugin.php @@ -1,4 +1,5 @@ addChainFunction("Contenido.ArticleCategoryList.ListItems", "piworkflowCreateTasksFolder"); $_cecRegistry->addChainFunction("Contenido.ArticleList.Columns", "piworkflowProcessArticleColumns"); @@ -62,392 +62,10 @@ $_cecRegistry->addChainFunction("Contenido.CategoryList.Columns", "piworkflowCat $_cecRegistry->addChainFunction("Contenido.CategoryList.RenderColumn", "piworkflowCategoryRenderColumn"); $_cecRegistry->addChainFunction("Contenido.Frontend.AllowEdit", "piworkflowAllowArticleEdit"); -function prepareWorkflowItems () -{ - global $action, $lang, $modidcat, $workflowSelectBox, $workflowworkflows, $client, $tpl, $cfg; - - $workflowworkflows = new Workflows; - - if ($action === 'workflow_inherit_down') - { - $tmp = strDeeperCategoriesArray($modidcat); - $asworkflow = getWorkflowForCat($modidcat); - - $wfa = new WorkflowAllocations; - - foreach ($tmp as $tmp_cat) - { - $idcatlang = getCatLang ($tmp_cat, $lang); - - if ($asworkflow == 0) - { - $wfa->select("idcatlang = '$idcatlang'"); - - if ($item = $wfa->next()) - { - $wfa->delete($item->get("idallocation")); - # delete user sequences for listing in tasklist for each included article - $oArticles = new ArticleCollection(array('idcat' => $idcatlang, 'start' => true, 'offline' => true)); - while ($oArticle = $oArticles->nextArticle()) { - setUserSequence($oArticle->getField('idartlang'), -1); - } - } - } else { - $wfa->select("idcatlang = '$idcatlang'"); - - if ($item = $wfa->next()) - { - $item->setWorkflow($asworkflow); - $item->store(); - } else { - $wfa->create($asworkflow, $idcatlang); - # generate user sequences for listing in tasklist for each included article - $oArticles = new ArticleCollection(array('idcat' => $tmp_cat, 'start' => true, 'offline' => true)); - while ($oArticle = $oArticles->nextArticle()) { - setUserSequence($oArticle->getField('idartlang'), $asworkflow); - } - } - } - } - } - if ($action == "workflow_cat_assign") - { - $seltpl = "wfselect".$modidcat; - - $wfa = new WorkflowAllocations; - $idcatlang = getCatLang($modidcat, $lang); - - #associate workflow with category - if ($GLOBALS[$seltpl] != 0) - { - $wfa->select("idcatlang = '$idcatlang'"); - if ($item = $wfa->next()) - { - $item->setWorkflow($GLOBALS[$seltpl]); - $item->store(); - } else { - $wfa->create($GLOBALS[$seltpl], $idcatlang); - } - - # generate user sequences for listing in tasklist for each included article - $oArticles = new ArticleCollection(array('idcat' => $modidcat, 'start' => true, 'offline' => true)); - while ($oArticle = $oArticles->nextArticle()) { - setUserSequence($oArticle->getField('idartlang'), $GLOBALS[$seltpl]); - } - #unlink workflow with category - } else { - $wfa->select("idcatlang = '$idcatlang'"); - - if ($item = $wfa->next()) - { - $alloc = $item->get("idallocation"); - } - $wfa->delete($alloc); - - # delete user sequences for listing in tasklist for each included article - $oArticles = new ArticleCollection(array('idcat' => $modidcat, 'start' => true, 'offline' => true)); - while ($oArticle = $oArticles->nextArticle()) { - setUserSequence($oArticle->getField('idartlang'), -1); - } - - } - } - - $workflowSelectBox = new cHTMLSelectElement("foo"); - $workflowSelectBox->setClass("text_medium"); - $workflowworkflows->select("idclient = '$client' AND idlang = '".Contenido_Security::escapeDB($lang, null)."'"); - - $workflowOption = new cHTMLOptionElement("--- ".i18n("None", "workflow")." ---", 0); - $workflowSelectBox->addOptionElement(0,$workflowOption); - - while ($workflow = $workflowworkflows->next()) - { - $workflowOption = new cHTMLOptionElement($workflow->get("name"), $workflow->get("idworkflow")); - $workflowSelectBox->addOptionElement($workflow->get("idworkflow"),$workflowOption); - } - - $workflowSelectBox->updateAttributes(array("id" => "wfselect{IDCAT}")); - $workflowSelectBox->updateAttributes(array("name" => "wfselect{IDCAT}")); - - $tpl->set('s', 'PLUGIN_WORKFLOW', $workflowSelectBox->render().''); - $tpl->set('s', 'PLUGIN_WORKFLOW_TRANSLATION', i18n("Inherit workflow down", "workflow")); -} - -function piworkflowCategoryRenderColumn ($idcat, $type) -{ - - switch ($type) - { - case "workflow": - $value = workflowInherit($idcat).''; - break; - } - - return ($value); -} - -function piworkflowCategoryColumns ($array) -{ - prepareWorkflowItems(); - $myarray = array("workflow" => i18n("Workflow", "workflow")); - - return ($myarray); -} - -function piworkflowProcessActions ($array) -{ - global $idcat; - $defaultidworkflow = getWorkflowForCat($idcat); - - if ($defaultidworkflow != 0) - { - $narray = array("todo", - "wfartconf", - "wftplconf", - "wfonline", - "wflocked", - "duplicate", - "delete", - "usetime"); - } else { - $narray = $array; - } - - return ($narray); -} - -function piworkflowRenderAction ($idcat, $idart, $idartlang, $type) -{ - global $area, $frame, $idtpl, $cfg, $alttitle, $tmp_articletitle; - global $tmp_artconf, $onlinelink, $lockedlink, $tplconf_link; - - $defaultidworkflow = getWorkflowForCat($idcat); - - $idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow); - $associatedUserSequence = new WorkflowUserSequence; - $associatedUserSequence->loadByPrimaryKey($idusersequence); - - $currentEditor = $associatedUserSequence->get("iduser"); - $workflowItem = $associatedUserSequence->getWorkflowItem(); - - if (isCurrentEditor($associatedUserSequence->get("iduser"))) - { - /* Query rights for this user */ - $wfRights = $workflowItem->getStepRights(); - $mayEdit = true; - } else { - $wfRights = ""; - $mayEdit = false; - } - - switch ($type) - { - case "wfartconf": - if ($wfRights["propertyedit"] == true) - { - return $tmp_artconf; - } - break; - case "wfonline": - if ($wfRights["publish"] == true) - { - return $onlinelink; - } - break; - case "wflocked": - if ($wfRights["lock"] == true) - { - return $lockedlink; - } - break; - case "wftplconf": - if ($wfRights["templateedit"] == true) - { - return $tplconf_link; - } - default: - break; - } - - return ""; -} -function piworkflowProcessArticleColumns ($array) -{ - global $idcat, $action, $modidartlang; - - if ($action == "workflow_do_action") - { - $selectedAction = "wfselect".$modidartlang; - doWorkflowAction($modidartlang, $GLOBALS[$selectedAction]); - - } - - $defaultidworkflow = getWorkflowForCat($idcat); - - if ($defaultidworkflow != 0) - { - $narray = array(); - $bInserted = false; - foreach ($array as $sKey => $sValue) { - $narray[$sKey] = $sValue; - if ($sKey == 'title' && !$bInserted) { - $narray["wftitle"] = $array["title"]; - $narray["wfstep"] = i18n("Workflow Step", "workflow"); - $narray["wfaction"] = i18n("Workflow Action", "workflow"); - $narray["wfeditor"] = i18n("Workflow Editor", "workflow"); - $narray["wflaststatus"] = i18n("Last status", "workflow"); - $bInserted = true; - } - } - unset ($narray['title']); - unset ($narray['changeddate']); - unset ($narray['publisheddate']); - unset ($narray['sortorder']); - } else { - $narray = $array; - } - - return ($narray); -} - -function piworkflowAllowArticleEdit ($idlang, $idcat, $idart, $user) -{ - $defaultidworkflow = getWorkflowForCat($idcat); - - if ($defaultidworkflow == 0) - { - return true; - } - - $idartlang = getArtLang($idart, $idlang); - $idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow); - $associatedUserSequence = new WorkflowUserSequence; - $associatedUserSequence->loadByPrimaryKey($idusersequence); - - $currentEditor = $associatedUserSequence->get("iduser"); - - $workflowItem = $associatedUserSequence->getWorkflowItem(); - - if (isCurrentEditor($associatedUserSequence->get("iduser"))) - { - $wfRights = $workflowItem->getStepRights(); - $mayEdit = true; - } else { - $wfRights = ""; - $mayEdit = false; - } - - if ($wfRights["articleedit"] == true) - { - return true; - } else { - return false; - } - -} -function piworkflowRenderColumn ($idcat, $idart, $idartlang, $column) -{ - global $area, $frame, $idtpl, $cfg, $alttitle, $tmp_articletitle; - $defaultidworkflow = getWorkflowForCat($idcat); - - $idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow); - $associatedUserSequence = new WorkflowUserSequence; - $associatedUserSequence->loadByPrimaryKey($idusersequence); - - $currentEditor = $associatedUserSequence->get("iduser"); - - $workflowItem = $associatedUserSequence->getWorkflowItem(); - - if (isCurrentEditor($associatedUserSequence->get("iduser"))) - { - $wfRights = $workflowItem->getStepRights(); - $mayEdit = true; - } else { - $wfRights = ""; - $mayEdit = false; - } - - switch ($column) - { - case "wftitle": - if ($wfRights["articleedit"] == true) - { - $mtitle = $tmp_articletitle; - } else { - $mtitle = strip_tags($tmp_articletitle); - } - return ($mtitle); - case "wfstep": - if ($workflowItem === false) - { - return "nobody"; - } - - return ($workflowItem->get("position").".) ".$workflowItem->get("name")); - case "wfeditor": - $sEditor = getGroupOrUserName($currentEditor); - if (!$sEditor) { - $sEditor = "nobody"; - } - return $sEditor; - case "wfaction": - $defaultidworkflow = getWorkflowForCat($idcat); - $idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow); - - $sActionSelect = getActionSelect($idartlang, $idusersequence); - if (!$sActionSelect) { - $mayEdit = false; - } - - $form = new UI_Form("wfaction".$idartlang, "main.php", "get"); - $form->setVar("area",$area); - $form->setVar("action","workflow_do_action"); - $form->setVar("frame", $frame); - $form->setVar("idcat", $idcat); - $form->setVar("modidartlang", $idartlang); - $form->setVar("idtpl", $idtpl); - $form->add("select", '
'.$sActionSelect.''); - $form->add("button", '
'); - - if ($mayEdit == true) - { - return ($form->render(true)); - } else { - return '--- ' . i18n("None") . ' ---'; - } - - case "wflaststatus": - $sStatus = getLastWorkflowStatus($idartlang); - if (!$sStatus) { - $sStatus = '--- ' . i18n("None") . ' ---'; - } - return $sStatus; - - } -} - -function piworkflowCreateTasksFolder () -{ - global $sess, $cfg; - - $item = array(); - /* Create workflow tasks folder */ - $tmp_mstr = '%s'; - - $mstr = sprintf($tmp_mstr, 'right_bottom', - $sess->url("main.php?area=con_workflow&frame=4"), - 'right_top', - $sess->url("main.php?area=con_workflow&frame=3"), - 'Workflow / Todo'); - - $item["image"] = ''; - $item["title"] = $mstr; - - - return ($item); -} - - - -?> +$cfg["tab"]["workflow"] = $cfg['sql']['sqlprefix'] . "_piwf_workflow"; +$cfg["tab"]["workflow_allocation"] = $cfg['sql']['sqlprefix'] . "_piwf_allocation"; +$cfg["tab"]["workflow_art_allocation"] = $cfg['sql']['sqlprefix'] . "_piwf_art_allocation"; +$cfg["tab"]["workflow_items"] = $cfg['sql']['sqlprefix'] . "_piwf_items"; +$cfg["tab"]["workflow_user_sequences"] = $cfg['sql']['sqlprefix'] . "_piwf_user_sequences"; +$cfg["tab"]["workflow_actions"] = $cfg['sql']['sqlprefix'] . "_piwf_actions"; \ No newline at end of file diff --git a/includes/functions.workflow.php b/includes/functions.workflow.php index bba6d7f..d66e7d3 100644 --- a/includes/functions.workflow.php +++ b/includes/functions.workflow.php @@ -1,4 +1,5 @@ getAccessibleUsers(explode(',', $auth->auth['perm'])); - $grouplist = new Groups; - $groups = $grouplist->getAccessibleGroups(explode(',', $auth->auth['perm'])); - - $tpl2 = new Template; - $tpl2->set('s', 'NAME', 'user'.$listid); + $userlist = new Users; + $users = $userlist->getAccessibleUsers(explode(',', $auth->auth['perm'])); + $grouplist = new Groups; + $groups = $grouplist->getAccessibleGroups(explode(',', $auth->auth['perm'])); + + $tpl2 = new Template; + $tpl2->set('s', 'NAME', 'user' . $listid); $tpl2->set('s', 'CLASS', 'text_small'); $tpl2->set('s', 'OPTIONS', 'size=1'); - $tpl2->set('d', 'VALUE', 0); - $tpl2->set('d', 'CAPTION', '--- '.i18n("None", "workflow").' ---'); - if ($default == 0) - { - $tpl2->set('d', 'SELECTED', 'SELECTED'); - } else { - $tpl2->set('d', 'SELECTED', ''); - } - $tpl2->next(); - - if ( is_array($users) ) - { + $tpl2->set('d', 'VALUE', 0); + $tpl2->set('d', 'CAPTION', '--- ' . i18n("None", "workflow") . ' ---'); + if ($default == 0) { + $tpl2->set('d', 'SELECTED', 'SELECTED'); + } else { + $tpl2->set('d', 'SELECTED', ''); + } + $tpl2->next(); - foreach ($users as $key => $value) - { + if (is_array($users)) { - $tpl2->set('d', 'VALUE', $key); - $tpl2->set('d', 'CAPTION', $value["realname"] . " (".$value["username"].")"); - - if ($default == $key) - { - $tpl2->set('d', 'SELECTED', 'SELECTED'); - } else { - $tpl2->set('d', 'SELECTED', ''); - } - - $tpl2->next(); - } - } + foreach ($users as $key => $value) { - $tpl2->set('d', 'VALUE', '0'); - $tpl2->set('d', 'CAPTION', '------------------------------------'); - $tpl2->set('d', 'SELECTED', 'disabled'); - $tpl2->next(); - - if ( is_array($groups) ) - { + $tpl2->set('d', 'VALUE', $key); + $tpl2->set('d', 'CAPTION', $value["realname"] . " (" . $value["username"] . ")"); - foreach ($groups as $key => $value) - { + if ($default == $key) { + $tpl2->set('d', 'SELECTED', 'SELECTED'); + } else { + $tpl2->set('d', 'SELECTED', ''); + } - $tpl2->set('d', 'VALUE', $key); - $tpl2->set('d', 'CAPTION', $value["groupname"]); - - if ($default == $key) - { - $tpl2->set('d', 'SELECTED', 'SELECTED'); - } else { - $tpl2->set('d', 'SELECTED', ''); - } - $tpl2->next(); } - - } + } - return $tpl2->generate($cfg['path']['templates'].$cfg['templates']['generic_select'], true); - + $tpl2->set('d', 'VALUE', '0'); + $tpl2->set('d', 'CAPTION', '------------------------------------'); + $tpl2->set('d', 'SELECTED', 'disabled'); + $tpl2->next(); + + if (is_array($groups)) { + + foreach ($groups as $key => $value) { + + $tpl2->set('d', 'VALUE', $key); + $tpl2->set('d', 'CAPTION', $value["groupname"]); + + if ($default == $key) { + $tpl2->set('d', 'SELECTED', 'SELECTED'); + } else { + $tpl2->set('d', 'SELECTED', ''); + } + + $tpl2->next(); + } + } + + return $tpl2->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true); } -function isCurrentEditor ($uid) -{ - global $auth, $cfg; - +function isCurrentEditor($uid) { + global $auth, $cfg; + /* Check if the UID is a group. If yes, check if we are in it */ $user = new User; - if ($user->loadUserByUserID($uid) == false) - { - $db2 = new DB_ConLite; - - /* Yes, it's a group. Let's try to load the group members! */ - $sql = "SELECT user_id FROM " - .$cfg["tab"]["groupmembers"]." - WHERE group_id = '".Contenido_Security::escapeDB($uid,$db2)."'"; - + if ($user->loadUserByUserID($uid) == false) { + $db2 = new DB_ConLite; + + /* Yes, it's a group. Let's try to load the group members! */ + $sql = "SELECT user_id FROM " + . $cfg["tab"]["groupmembers"] . " + WHERE group_id = '" . Contenido_Security::escapeDB($uid, $db2) . "'"; + $db2->query($sql); - - while ($db2->next_record()) - { - if ($db2->f("user_id") == $auth->auth["uid"]) - { - return true; - } + + while ($db2->next_record()) { + if ($db2->f("user_id") == $auth->auth["uid"]) { + return true; + } } } else { - if ($uid == $auth->auth["uid"]) - { - return true; - } + if ($uid == $auth->auth["uid"]) { + return true; + } } - + return false; } -function getActionSelect ($idartlang, $idusersequence) -{ - global $cfg; - - $workflowActions = new WorkflowActions; - - $allActions = $workflowActions->getAvailableWorkflowActions(); +function getActionSelect($idartlang, $idusersequence) { + global $cfg; + + $workflowActions = new WorkflowActions; + + $allActions = $workflowActions->getAvailableWorkflowActions(); + + $wfSelect = new Template; + $wfSelect->set('s', 'NAME', 'wfselect' . $idartlang); + $wfSelect->set('s', 'CLASS', 'text_medium'); + + $userSequence = new WorkflowUserSequence; + $userSequence->loadByPrimaryKey($idusersequence); - $wfSelect = new Template; - $wfSelect->set('s', 'NAME', 'wfselect'.$idartlang); - $wfSelect->set('s', 'CLASS', 'text_medium'); - - $userSequence = new WorkflowUserSequence; - $userSequence->loadByPrimaryKey($idusersequence); - $workflowItem = $userSequence->getWorkflowItem(); - - if ($workflowItem === false) - { - return; + + if ($workflowItem === false) { + return; } - + $wfRights = $workflowItem->getStepRights(); - + $artAllocation = new WorkflowArtAllocations; $artAllocation->select("idartlang = '$idartlang'"); - - if ($obj = $artAllocation->next()) - { - $laststep = $obj->get("lastusersequence"); + + if ($obj = $artAllocation->next()) { + $laststep = $obj->get("lastusersequence"); } - + $bExistOption = false; - if ($laststep != $idusersequence) - { - $wfSelect->set('d', 'VALUE', 'next'); - $wfSelect->set('d', 'CAPTION', i18n("Confirm", "workflow")); - $wfSelect->set('d', 'SELECTED', 'SELECTED'); - $wfSelect->next(); + if ($laststep != $idusersequence) { + $wfSelect->set('d', 'VALUE', 'next'); + $wfSelect->set('d', 'CAPTION', i18n("Confirm", "workflow")); + $wfSelect->set('d', 'SELECTED', 'SELECTED'); + $wfSelect->next(); $bExistOption = true; - } - - if ($wfRights["last"] == true) - { - $wfSelect->set('d', 'VALUE', 'last'); - $wfSelect->set('d', 'CAPTION', i18n("Back to last editor", "workflow")); - $wfSelect->set('d', 'SELECTED', ''); - $wfSelect->next(); + } + + if ($wfRights["last"] == true) { + $wfSelect->set('d', 'VALUE', 'last'); + $wfSelect->set('d', 'CAPTION', i18n("Back to last editor", "workflow")); + $wfSelect->set('d', 'SELECTED', ''); + $wfSelect->next(); $bExistOption = true; - } - - if ($wfRights["reject"] == true) - { - $wfSelect->set('d', 'VALUE', 'reject'); - $wfSelect->set('d', 'CAPTION', i18n("Reject article", "workflow")); - $wfSelect->set('d', 'SELECTED', ''); - $wfSelect->next(); + } + + if ($wfRights["reject"] == true) { + $wfSelect->set('d', 'VALUE', 'reject'); + $wfSelect->set('d', 'CAPTION', i18n("Reject article", "workflow")); + $wfSelect->set('d', 'SELECTED', ''); + $wfSelect->next(); $bExistOption = true; - } - - if ($wfRights["revise"] == true) - { - $wfSelect->set('d', 'VALUE', 'revise'); - $wfSelect->set('d', 'CAPTION', i18n("Revise article", "workflow")); - $wfSelect->set('d', 'SELECTED', ''); - $wfSelect->next(); + } + + if ($wfRights["revise"] == true) { + $wfSelect->set('d', 'VALUE', 'revise'); + $wfSelect->set('d', 'CAPTION', i18n("Revise article", "workflow")); + $wfSelect->set('d', 'SELECTED', ''); + $wfSelect->next(); $bExistOption = true; - } - + } + if ($bExistOption) - return ($wfSelect->generate($cfg['path']['templates'].$cfg['templates']['generic_select'], true)); + return ($wfSelect->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true)); else { return false; } } #function for inserting todos in wokflow_art_allocation used, when a workflow is associated with a category in content->category -function setUserSequence ($idartlang, $defaultidworkflow) { + +function setUserSequence($idartlang, $defaultidworkflow) { $wfaa = new WorkflowArtAllocations; $wfaa->select("idartlang = '$idartlang'"); $idusersequence = 0; - - if ($associatedUserSequence = $wfaa->next()) - { + + if ($associatedUserSequence = $wfaa->next()) { $idartallocation = $associatedUserSequence->get("idartallocation"); $wfaa->delete($idartallocation); } - + if ($defaultidworkflow != -1) { $newObj = $wfaa->create($idartlang); - - if (!$newObj) - { + + if (!$newObj) { /* Try to load */ $newObj = new WorkflowArtAllocation; - + echo $wfaa->lasterror; return false; } - + /* Get the first idusersequence for the new item */ $workflowItems = new WorkflowItems; $workflowItems->select("idworkflow = '$defaultidworkflow' AND position = '1'"); - - if ($obj = $workflowItems->next()) - { + + if ($obj = $workflowItems->next()) { $firstitem = $obj->get("idworkflowitem"); } - + $workflowUserSequences = new WorkflowUserSequences; $workflowUserSequences->select("idworkflowitem = '$firstitem' AND position = '1'"); - - if ($obj = $workflowUserSequences->next()) - { + + if ($obj = $workflowUserSequences->next()) { $firstIDUserSequence = $obj->get("idusersequence"); } - + $newObj->set("idusersequence", $firstIDUserSequence); $newObj->store(); $idusersequence = $newObj->get("idusersequence"); $associatedUserSequence = $newObj; - } + } } -function getCurrentUserSequence ($idartlang, $defaultidworkflow) -{ - $wfaa = new WorkflowArtAllocations; - $wfaa->select("idartlang = '$idartlang'"); - $idusersequence = 0; - - if ($associatedUserSequence = $wfaa->next()) - { - $idusersequence = $associatedUserSequence->get("idusersequence"); +function getCurrentUserSequence($idartlang, $defaultidworkflow) { + $wfaa = new WorkflowArtAllocations; + $wfaa->select("idartlang = '$idartlang'"); + $idusersequence = 0; + + if ($associatedUserSequence = $wfaa->next()) { + $idusersequence = $associatedUserSequence->get("idusersequence"); + } + + if ($idusersequence == 0) { + if ($associatedUserSequence != false) { + $newObj = $associatedUserSequence; + } else { + $newObj = $wfaa->create($idartlang); + + if (!$newObj) { + /* Try to load */ + $newObj = new WorkflowArtAllocation; + + echo $wfaa->lasterror; + return false; + } } - - if ($idusersequence == 0) - { - if ($associatedUserSequence != false) - { - $newObj = $associatedUserSequence; - } else { - $newObj = $wfaa->create($idartlang); - - if (!$newObj) - { - /* Try to load */ - $newObj = new WorkflowArtAllocation; - - echo $wfaa->lasterror; - return false; + + /* Get the first idusersequence for the new item */ + $workflowItems = new WorkflowItems; + $workflowItems->select("idworkflow = '$defaultidworkflow' AND position = '1'"); + + if ($obj = $workflowItems->next()) { + $firstitem = $obj->get("idworkflowitem"); + } + + $workflowUserSequences = new WorkflowUserSequences; + $workflowUserSequences->select("idworkflowitem = '$firstitem' AND position = '1'"); + + if ($obj = $workflowUserSequences->next()) { + $firstIDUserSequence = $obj->get("idusersequence"); + } + + $newObj->set("idusersequence", $firstIDUserSequence); + $newObj->store(); + + $idusersequence = $newObj->get("idusersequence"); + $associatedUserSequence = $newObj; + } + + return ($idusersequence); +} + +function getLastWorkflowStatus($idartlang) { + $wfaa = new WorkflowArtAllocations; + + $wfaa->select("idartlang = '$idartlang'"); + + if ($associatedUserSequence = $wfaa->next()) { + $laststatus = $associatedUserSequence->get("laststatus"); + } else { + return false; + } + + switch ($laststatus) { + case "reject": + return (i18n("Rejected", "workflow")); + break; + case "revise": + return (i18n("Revised", "workflow")); + break; + case "last": + return (i18n("Last", "workflow")); + break; + case "confirm": + return (i18n("Confirmed", "workflow")); + break; + default: + return (i18n("None", "workflow")); + break; + } + return (""); +} + +function doWorkflowAction($idartlang, $action) { + global $cfg, $idcat; + + switch ($action) { + case "last": + $artAllocations = new WorkflowArtAllocations; + $artAllocations->select("idartlang = '$idartlang'"); + + if ($obj = $artAllocations->next()) { + $usersequence = new WorkflowUserSequence; + $usersequence->loadByPrimaryKey($obj->get("idusersequence")); + + $workflowitem = $usersequence->getWorkflowItem(); + + $idworkflow = $workflowitem->get("idworkflow"); + $newpos = $workflowitem->get("position") - 1; + + if ($newpos < 1) { + $newpos = 1; + } + + $workflowitems = new WorkflowItems; + $workflowitems->select("idworkflow = '$idworkflow' AND position = '" . Contenido_Security::escapeDB($newpos, NULL) . "'"); + + if ($nextObj = $workflowitems->next()) { + $userSequences = new WorkflowUserSequences; + $idworkflowitem = $nextObj->get("idworkflowitem"); + $userSequences->select("idworkflowitem = '$idworkflowitem'"); + + if ($nextSeqObj = $userSequences->next()) { + $obj->set("lastusersequence", $obj->get("idusersequence")); + $obj->set("idusersequence", $nextSeqObj->get("idusersequence")); + $obj->set("laststatus", "last"); + $obj->store(); + } } } - - /* Get the first idusersequence for the new item */ - $workflowItems = new WorkflowItems; - $workflowItems->select("idworkflow = '$defaultidworkflow' AND position = '1'"); - - if ($obj = $workflowItems->next()) - { - $firstitem = $obj->get("idworkflowitem"); - } - - $workflowUserSequences = new WorkflowUserSequences; - $workflowUserSequences->select("idworkflowitem = '$firstitem' AND position = '1'"); - - if ($obj = $workflowUserSequences->next()) - { - $firstIDUserSequence = $obj->get("idusersequence"); - } + break; + case "next": + $artAllocations = new WorkflowArtAllocations; + $artAllocations->select("idartlang = '$idartlang'"); - $newObj->set("idusersequence", $firstIDUserSequence); - $newObj->store(); - - $idusersequence = $newObj->get("idusersequence"); - $associatedUserSequence = $newObj; - } - - return ($idusersequence); + if ($obj = $artAllocations->next()) { + $usersequence = new WorkflowUserSequence; + $usersequence->loadByPrimaryKey($obj->get("idusersequence")); + + $workflowitem = $usersequence->getWorkflowItem(); + + $idworkflow = $workflowitem->get("idworkflow"); + $newpos = $workflowitem->get("position") + 1; + + $workflowitems = new WorkflowItems; + $workflowitems->select("idworkflow = '$idworkflow' AND position = '" . Contenido_Security::escapeDB($newpos, NULL) . "'"); + + if ($nextObj = $workflowitems->next()) { + $userSequences = new WorkflowUserSequences; + $idworkflowitem = $nextObj->get("idworkflowitem"); + $userSequences->select("idworkflowitem = '$idworkflowitem'"); + + if ($nextSeqObj = $userSequences->next()) { + $obj->set("lastusersequence", '10'); + $obj->set("idusersequence", $nextSeqObj->get("idusersequence")); + $obj->set("laststatus", "confirm"); + $obj->store(); + } + } else { + $workflowitems->select("idworkflow = '$idworkflow' AND position = '" . Contenido_Security::escapeDB($workflowitem->get("position"), NULL) . "'"); + if ($nextObj = $workflowitems->next()) { + $userSequences = new WorkflowUserSequences; + $idworkflowitem = $nextObj->get("idworkflowitem"); + $userSequences->select("idworkflowitem = '$idworkflowitem'"); + + if ($nextSeqObj = $userSequences->next()) { + $obj->set("lastusersequence", $obj->get("idusersequence")); + $obj->set("idusersequence", $nextSeqObj->get("idusersequence")); + $obj->set("laststatus", "confirm"); + $obj->store(); + } + } + } + } + break; + case "reject": + $artAllocations = new WorkflowArtAllocations; + $artAllocations->select("idartlang = '$idartlang'"); + + if ($obj = $artAllocations->next()) { + $usersequence = new WorkflowUserSequence; + $usersequence->loadByPrimaryKey($obj->get("idusersequence")); + + $workflowitem = $usersequence->getWorkflowItem(); + + $idworkflow = $workflowitem->get("idworkflow"); + $newpos = 1; + + $workflowitems = new WorkflowItems; + $workflowitems->select("idworkflow = '$idworkflow' AND position = '" . Contenido_Security::escapeDB($newpos, NULL) . "'"); + + if ($nextObj = $workflowitems->next()) { + $userSequences = new WorkflowUserSequences; + $idworkflowitem = $nextObj->get("idworkflowitem"); + $userSequences->select("idworkflowitem = '$idworkflowitem'"); + + if ($nextSeqObj = $userSequences->next()) { + $obj->set("lastusersequence", $obj->get("idusersequence")); + $obj->set("idusersequence", $nextSeqObj->get("idusersequence")); + $obj->set("laststatus", "reject"); + $obj->store(); + } + } + } + break; + + case "revise": + $db = new DB_ConLite; + $sql = "SELECT idart, idlang FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang = '" . Contenido_Security::escapeDB($idartlang, $db) . "'"; + $db->query($sql); + $db->next_record(); + $idart = $db->f("idart"); + $idlang = $db->f("idlang"); + + $newidart = conCopyArticle($idart, $idcat, "foo"); + + break; + default: + } } -function getLastWorkflowStatus ($idartlang) -{ - $wfaa = new WorkflowArtAllocations; - - $wfaa->select("idartlang = '$idartlang'"); - - if ($associatedUserSequence = $wfaa->next()) - { - $laststatus = $associatedUserSequence->get("laststatus"); - } else { - return false; - } - - switch ($laststatus) - { - case "reject": - return (i18n("Rejected", "workflow")); - break; - case "revise": - return (i18n("Revised", "workflow")); - break; - case "last": - return (i18n("Last", "workflow")); - break; - case "confirm": - return (i18n("Confirmed", "workflow")); - break; - default: - return (i18n("None", "workflow")); - break; - } - return (""); +function getWorkflowForUserSequence($usersequence) { + $usersequences = new WorkflowUserSequences; + $workflowitems = new WorkflowItems; + $usersequences->select("idusersequence = '$usersequence'"); + + if ($obj = $usersequences->next()) { + $idworkflowitem = $obj->get("idworkflowitem"); + } else { + return false; + } + + $workflowitems->select("idworkflowitem = '$idworkflowitem'"); + if ($obj = $workflowitems->next()) { + return $obj->get("idworkflow"); + } else { + return false; + } } -function doWorkflowAction ($idartlang, $action) -{ - global $cfg, $idcat; - - switch ($action) - { - case "last": - $artAllocations = new WorkflowArtAllocations; - $artAllocations->select("idartlang = '$idartlang'"); - - if ($obj = $artAllocations->next()) - { - $usersequence = new WorkflowUserSequence; - $usersequence->loadByPrimaryKey($obj->get("idusersequence")); - - $workflowitem = $usersequence->getWorkflowItem(); - - $idworkflow = $workflowitem->get("idworkflow"); - $newpos = $workflowitem->get("position") - 1; - - if ($newpos < 1) - { - $newpos = 1; - } - - $workflowitems = new WorkflowItems; - $workflowitems->select("idworkflow = '$idworkflow' AND position = '".Contenido_Security::escapeDB($newpos, NULL)."'"); - - if ($nextObj = $workflowitems->next()) - { - $userSequences = new WorkflowUserSequences; - $idworkflowitem = $nextObj->get("idworkflowitem"); - $userSequences->select("idworkflowitem = '$idworkflowitem'"); - - if ($nextSeqObj = $userSequences->next()) - { - $obj->set("lastusersequence", $obj->get("idusersequence")); - $obj->set("idusersequence",$nextSeqObj->get("idusersequence")); - $obj->set("laststatus", "last"); - $obj->store(); - } - } - } - break; - case "next": - $artAllocations = new WorkflowArtAllocations; - $artAllocations->select("idartlang = '$idartlang'"); - - if ($obj = $artAllocations->next()) - { - $usersequence = new WorkflowUserSequence; - $usersequence->loadByPrimaryKey($obj->get("idusersequence")); - - $workflowitem = $usersequence->getWorkflowItem(); - - $idworkflow = $workflowitem->get("idworkflow"); - $newpos = $workflowitem->get("position") + 1; - - $workflowitems = new WorkflowItems; - $workflowitems->select("idworkflow = '$idworkflow' AND position = '".Contenido_Security::escapeDB($newpos, NULL)."'"); - - if ($nextObj = $workflowitems->next()) - { - $userSequences = new WorkflowUserSequences; - $idworkflowitem = $nextObj->get("idworkflowitem"); - $userSequences->select("idworkflowitem = '$idworkflowitem'"); - - if ($nextSeqObj = $userSequences->next()) - { - $obj->set("lastusersequence", '10'); - $obj->set("idusersequence",$nextSeqObj->get("idusersequence")); - $obj->set("laststatus", "confirm"); - $obj->store(); - } - } else { - $workflowitems->select("idworkflow = '$idworkflow' AND position = '".Contenido_Security::escapeDB($workflowitem->get("position"), NULL)."'"); - if ($nextObj = $workflowitems->next()) - { - $userSequences = new WorkflowUserSequences; - $idworkflowitem = $nextObj->get("idworkflowitem"); - $userSequences->select("idworkflowitem = '$idworkflowitem'"); - - if ($nextSeqObj = $userSequences->next()) - { - $obj->set("lastusersequence", $obj->get("idusersequence")); - $obj->set("idusersequence",$nextSeqObj->get("idusersequence")); - $obj->set("laststatus", "confirm"); - $obj->store(); - } - } - } - - } - break; - case "reject": - $artAllocations = new WorkflowArtAllocations; - $artAllocations->select("idartlang = '$idartlang'"); - - if ($obj = $artAllocations->next()) - { - $usersequence = new WorkflowUserSequence; - $usersequence->loadByPrimaryKey($obj->get("idusersequence")); - - $workflowitem = $usersequence->getWorkflowItem(); - - $idworkflow = $workflowitem->get("idworkflow"); - $newpos = 1; - - $workflowitems = new WorkflowItems; - $workflowitems->select("idworkflow = '$idworkflow' AND position = '".Contenido_Security::escapeDB($newpos, NULL)."'"); - - if ($nextObj = $workflowitems->next()) - { - $userSequences = new WorkflowUserSequences; - $idworkflowitem = $nextObj->get("idworkflowitem"); - $userSequences->select("idworkflowitem = '$idworkflowitem'"); - - if ($nextSeqObj = $userSequences->next()) - { - $obj->set("lastusersequence", $obj->get("idusersequence")); - $obj->set("idusersequence",$nextSeqObj->get("idusersequence")); - $obj->set("laststatus", "reject"); - $obj->store(); - } - } - } - break; - - case "revise": - $db = new DB_ConLite; - $sql = "SELECT idart, idlang FROM ".$cfg["tab"]["art_lang"] ." WHERE idartlang = '".Contenido_Security::escapeDB($idartlang, $db)."'"; - $db->query($sql); - $db->next_record(); - $idart = $db->f("idart"); - $idlang = $db->f("idlang"); - - $newidart = conCopyArticle($idart,$idcat, "foo"); - - break; - default: - } -} +function workflowSelect($listid, $default, $idcat) { + global $idclient, $cfg, $frame, $area, $workflowworkflows, $client, $lang, $wfcache, $workflowSelectBox; -function getWorkflowForUserSequence ($usersequence) -{ - $usersequences = new WorkflowUserSequences; - $workflowitems = new WorkflowItems; - $usersequences->select("idusersequence = '$usersequence'"); - - if ($obj = $usersequences->next()) - { - $idworkflowitem = $obj->get("idworkflowitem"); - } else { - return false; - } - - $workflowitems->select("idworkflowitem = '$idworkflowitem'"); - if ($obj = $workflowitems->next()) - { - return $obj->get("idworkflow"); - } else { - return false; - } -} - -function workflowSelect ($listid, $default, $idcat) -{ - global $idclient, $cfg, $frame, $area, $workflowworkflows, $client, $lang, $wfcache, $workflowSelectBox; - $oSelectBox = new cHTMLSelectElement('workflow'); $oSelectBox = $workflowSelectBox; - + $default = (int) $default; - $workflowSelectBox->updateAttributes(array("id" => "wfselect" . $idcat)); - $workflowSelectBox->updateAttributes(array("name" => "wfselect" . $idcat)); + $workflowSelectBox->updateAttributes(array("id" => "wfselect" . $idcat)); + $workflowSelectBox->updateAttributes(array("name" => "wfselect" . $idcat)); $workflowSelectBox->setDefault($default); - - $sButton =''; - - return $workflowSelectBox->render().$sButton; + + $sButton = ''; + + return $workflowSelectBox->render() . $sButton; } -function workflowInherit ($idcat) -{ - global $idclient, $cfg, $frame, $area, $workflowworkflows, $sess; - $sUrl = $sess->url("main.php?area=$area&frame=$frame&modidcat=$idcat&action=workflow_inherit_down"); - $sButton =''; +function workflowInherit($idcat) { + global $idclient, $cfg, $frame, $area, $workflowworkflows, $sess; + $sUrl = $sess->url("main.php?area=$area&frame=$frame&modidcat=$idcat&action=workflow_inherit_down"); + $sButton = ''; return $sButton; } -?> \ No newline at end of file +/* Helper functions */ + +function getWorkflowForCat($idcat) { + global $lang, $cfg; + + $idcatlang = getCatLang($idcat, $lang); + $workflows = new WorkflowAllocations; + $workflows->select("idcatlang = '$idcatlang'"); + if ($obj = $workflows->next()) { + /* Sanity: Check if the workflow still exists */ + $workflow = new Workflow; + + $res = $workflow->loadByPrimaryKey($obj->get("idworkflow")); + + if ($res == false) { + return 0; + } else { + return $obj->get("idworkflow"); + } + } +} + +function getCatLang($idcat, $idlang) { + global $lang, $cfg; + $db = new DB_ConLite; + + /* Get the idcatlang */ + $sql = "SELECT idcatlang FROM " + . $cfg["tab"]["cat_lang"] . + " WHERE idlang = '" . Contenido_Security::escapeDB($idlang, $db) . "' AND + idcat = '" . Contenido_Security::escapeDB($idcat, $db) . "'"; + + $db->query($sql); + + if ($db->next_record()) { + return ($db->f("idcatlang")); + } +} + +function prepareWorkflowItems() { + + global $action, $lang, $modidcat, $workflowSelectBox, $workflowworkflows, $client, $tpl, $cfg; + + $workflowworkflows = new Workflows; + + if ($action === 'workflow_inherit_down') { + $tmp = strDeeperCategoriesArray($modidcat); + $asworkflow = getWorkflowForCat($modidcat); + + $wfa = new WorkflowAllocations; + + foreach ($tmp as $tmp_cat) { + $idcatlang = getCatLang($tmp_cat, $lang); + + if ($asworkflow == 0) { + $wfa->select("idcatlang = '$idcatlang'"); + + if ($item = $wfa->next()) { + $wfa->delete($item->get("idallocation")); + # delete user sequences for listing in tasklist for each included article + $oArticles = new ArticleCollection(array('idcat' => $idcatlang, 'start' => true, 'offline' => true)); + while ($oArticle = $oArticles->nextArticle()) { + setUserSequence($oArticle->getField('idartlang'), -1); + } + } + } else { + $wfa->select("idcatlang = '$idcatlang'"); + + if ($item = $wfa->next()) { + $item->setWorkflow($asworkflow); + $item->store(); + } else { + $wfa->create($asworkflow, $idcatlang); + # generate user sequences for listing in tasklist for each included article + $oArticles = new ArticleCollection(array('idcat' => $tmp_cat, 'start' => true, 'offline' => true)); + while ($oArticle = $oArticles->nextArticle()) { + setUserSequence($oArticle->getField('idartlang'), $asworkflow); + } + } + } + } + } + if ($action == "workflow_cat_assign") { + $seltpl = "wfselect" . $modidcat; + + $wfa = new WorkflowAllocations; + $idcatlang = getCatLang($modidcat, $lang); + + #associate workflow with category + if ($GLOBALS[$seltpl] != 0) { + $wfa->select("idcatlang = '$idcatlang'"); + if ($item = $wfa->next()) { + $item->setWorkflow($GLOBALS[$seltpl]); + $item->store(); + } else { + $wfa->create($GLOBALS[$seltpl], $idcatlang); + } + + # generate user sequences for listing in tasklist for each included article + $oArticles = new ArticleCollection(array('idcat' => $modidcat, 'start' => true, 'offline' => true)); + while ($oArticle = $oArticles->nextArticle()) { + setUserSequence($oArticle->getField('idartlang'), $GLOBALS[$seltpl]); + } + #unlink workflow with category + } else { + $wfa->select("idcatlang = '$idcatlang'"); + + if ($item = $wfa->next()) { + $alloc = $item->get("idallocation"); + } + $wfa->delete($alloc); + + # delete user sequences for listing in tasklist for each included article + $oArticles = new ArticleCollection(array('idcat' => $modidcat, 'start' => true, 'offline' => true)); + while ($oArticle = $oArticles->nextArticle()) { + setUserSequence($oArticle->getField('idartlang'), -1); + } + } + } + + $workflowSelectBox = new cHTMLSelectElement("foo"); + $workflowSelectBox->setClass("text_medium"); + $workflowworkflows->select("idclient = '$client' AND idlang = '" . Contenido_Security::escapeDB($lang, null) . "'"); + + $workflowOption = new cHTMLOptionElement("--- " . i18n("None", "workflow") . " ---", 0); + $workflowSelectBox->addOptionElement(0, $workflowOption); + + while ($workflow = $workflowworkflows->next()) { + $workflowOption = new cHTMLOptionElement($workflow->get("name"), $workflow->get("idworkflow")); + $workflowSelectBox->addOptionElement($workflow->get("idworkflow"), $workflowOption); + } + + $workflowSelectBox->updateAttributes(array("id" => "wfselect{IDCAT}")); + $workflowSelectBox->updateAttributes(array("name" => "wfselect{IDCAT}")); + + $tpl->set('s', 'PLUGIN_WORKFLOW', $workflowSelectBox->render() . ''); + $tpl->set('s', 'PLUGIN_WORKFLOW_TRANSLATION', i18n("Inherit workflow down", "workflow")); +} + +function piworkflowCategoryRenderColumn($idcat, $type) { + + switch ($type) { + case "workflow": + $value = workflowInherit($idcat) . ''; + break; + } + + return ($value); +} + +function piworkflowCategoryColumns($array) { + prepareWorkflowItems(); + $myarray = array("workflow" => i18n("Workflow", "workflow")); + + return ($myarray); +} + +function piworkflowProcessActions($array) { + global $idcat; + $defaultidworkflow = getWorkflowForCat($idcat); + + if ($defaultidworkflow != 0) { + $narray = array("todo", + "wfartconf", + "wftplconf", + "wfonline", + "wflocked", + "duplicate", + "delete", + "usetime"); + } else { + $narray = $array; + } + + return ($narray); +} + +function piworkflowRenderAction($idcat, $idart, $idartlang, $type) { + global $area, $frame, $idtpl, $cfg, $alttitle, $tmp_articletitle; + global $tmp_artconf, $onlinelink, $lockedlink, $tplconf_link; + + $defaultidworkflow = getWorkflowForCat($idcat); + + $idusersequence = getCurrentUserSequence($idartlang, $defaultidworkflow); + $associatedUserSequence = new WorkflowUserSequence; + $associatedUserSequence->loadByPrimaryKey($idusersequence); + + $currentEditor = $associatedUserSequence->get("iduser"); + $workflowItem = $associatedUserSequence->getWorkflowItem(); + + if (isCurrentEditor($associatedUserSequence->get("iduser"))) { + /* Query rights for this user */ + $wfRights = $workflowItem->getStepRights(); + $mayEdit = true; + } else { + $wfRights = ""; + $mayEdit = false; + } + + switch ($type) { + case "wfartconf": + if ($wfRights["propertyedit"] == true) { + return $tmp_artconf; + } + break; + case "wfonline": + if ($wfRights["publish"] == true) { + return $onlinelink; + } + break; + case "wflocked": + if ($wfRights["lock"] == true) { + return $lockedlink; + } + break; + case "wftplconf": + if ($wfRights["templateedit"] == true) { + return $tplconf_link; + } + default: + break; + } + + return ""; +} + +function piworkflowProcessArticleColumns($array) { + global $idcat, $action, $modidartlang; + + if ($action == "workflow_do_action") { + $selectedAction = "wfselect" . $modidartlang; + doWorkflowAction($modidartlang, $GLOBALS[$selectedAction]); + } + + $defaultidworkflow = getWorkflowForCat($idcat); + + if ($defaultidworkflow != 0) { + $narray = array(); + $bInserted = false; + foreach ($array as $sKey => $sValue) { + $narray[$sKey] = $sValue; + if ($sKey == 'title' && !$bInserted) { + $narray["wftitle"] = $array["title"]; + $narray["wfstep"] = i18n("Workflow Step", "cl-workflow"); + $narray["wfaction"] = i18n("Workflow Action", "cl-workflow"); + $narray["wfeditor"] = i18n("Workflow Editor", "cl-workflow"); + $narray["wflaststatus"] = i18n("Last status", "cl-workflow"); + $bInserted = true; + } + } + unset($narray['title']); + unset($narray['changeddate']); + unset($narray['publisheddate']); + unset($narray['sortorder']); + } else { + $narray = $array; + } + + return ($narray); +} + +function piworkflowAllowArticleEdit($idlang, $idcat, $idart, $user) { + $defaultidworkflow = getWorkflowForCat($idcat); + + if ($defaultidworkflow == 0) { + return true; + } + + $idartlang = getArtLang($idart, $idlang); + $idusersequence = getCurrentUserSequence($idartlang, $defaultidworkflow); + $associatedUserSequence = new WorkflowUserSequence; + $associatedUserSequence->loadByPrimaryKey($idusersequence); + + $currentEditor = $associatedUserSequence->get("iduser"); + + $workflowItem = $associatedUserSequence->getWorkflowItem(); + + if (isCurrentEditor($associatedUserSequence->get("iduser"))) { + $wfRights = $workflowItem->getStepRights(); + $mayEdit = true; + } else { + $wfRights = ""; + $mayEdit = false; + } + + if ($wfRights["articleedit"] == true) { + return true; + } else { + return false; + } +} + +function piworkflowRenderColumn($idcat, $idart, $idartlang, $column) { + global $area, $frame, $idtpl, $cfg, $alttitle, $tmp_articletitle; + $defaultidworkflow = getWorkflowForCat($idcat); + + $idusersequence = getCurrentUserSequence($idartlang, $defaultidworkflow); + $associatedUserSequence = new WorkflowUserSequence; + $associatedUserSequence->loadByPrimaryKey($idusersequence); + + $currentEditor = $associatedUserSequence->get("iduser"); + + $workflowItem = $associatedUserSequence->getWorkflowItem(); + + if (isCurrentEditor($associatedUserSequence->get("iduser"))) { + $wfRights = $workflowItem->getStepRights(); + $mayEdit = true; + } else { + $wfRights = ""; + $mayEdit = false; + } + + switch ($column) { + case "wftitle": + if ($wfRights["articleedit"] == true) { + $mtitle = $tmp_articletitle; + } else { + $mtitle = strip_tags($tmp_articletitle); + } + return ($mtitle); + case "wfstep": + if ($workflowItem === false) { + return "nobody"; + } + + return ($workflowItem->get("position") . ".) " . $workflowItem->get("name")); + case "wfeditor": + $sEditor = getGroupOrUserName($currentEditor); + if (!$sEditor) { + $sEditor = "nobody"; + } + return $sEditor; + case "wfaction": + $defaultidworkflow = getWorkflowForCat($idcat); + $idusersequence = getCurrentUserSequence($idartlang, $defaultidworkflow); + + $sActionSelect = getActionSelect($idartlang, $idusersequence); + if (!$sActionSelect) { + $mayEdit = false; + } + + $form = new UI_Form("wfaction" . $idartlang, "main.php", "get"); + $form->setVar("area", $area); + $form->setVar("action", "workflow_do_action"); + $form->setVar("frame", $frame); + $form->setVar("idcat", $idcat); + $form->setVar("modidartlang", $idartlang); + $form->setVar("idtpl", $idtpl); + $form->add("select", '
' . $sActionSelect . ''); + $form->add("button", '
'); + + if ($mayEdit == true) { + return ($form->render(true)); + } else { + return '--- ' . i18n("None") . ' ---'; + } + + case "wflaststatus": + $sStatus = getLastWorkflowStatus($idartlang); + if (!$sStatus) { + $sStatus = '--- ' . i18n("None") . ' ---'; + } + return $sStatus; + } +} + +function piworkflowCreateTasksFolder() { + global $sess, $cfg; + + $item = array(); + /* Create workflow tasks folder */ + $tmp_mstr = '%s'; + + $mstr = sprintf($tmp_mstr, 'right_bottom', + $sess->url("main.php?area=con_workflow&frame=4"), + 'right_top', + $sess->url("main.php?area=con_workflow&frame=3"), + 'Workflow / Todo'); + + $item["image"] = ''; + $item["title"] = $mstr; + + + return ($item); +} \ No newline at end of file diff --git a/includes/include.workflow_edit.php b/includes/include.workflow_edit.php index 7d7e424..6adf0b9 100644 --- a/includes/include.workflow_edit.php +++ b/includes/include.workflow_edit.php @@ -31,7 +31,7 @@ if(!defined('CON_FRAMEWORK')) { } -plugin_include('workflow', 'classes/class.workflow.php'); +plugin_include('cl-workflow', 'classes/class.workflow.php'); $form = new UI_Table_Form("workflow_edit"); $userclass = new User; @@ -83,10 +83,10 @@ $form->setVar("frame", $frame); if ($workflow->virgin) { - $name = i18n("New Workflow", "workflow"); - $header = i18n("Create new workflow", "workflow"); + $name = i18n("New Workflow", "cl-workflow"); + $header = i18n("Create new workflow", "cl-workflow"); } else { - $header = i18n("Edit workflow", "workflow"); + $header = i18n("Edit workflow", "cl-workflow"); $description = $workflow->get("description"); $name = $workflow->get("name"); $created = $workflow->get("created"); @@ -94,10 +94,10 @@ if ($workflow->virgin) } $form->addHeader($header); -$form->add(i18n("Workflow name", "workflow"),formGenerateField("text","wfname",$name,40,255)); -$form->add(i18n("Description", "workflow"),formGenerateField("textbox","wfdescription",$description,50,10)); -$form->add(i18n("Author", "workflow"),$author); -$form->add(i18n("Created", "workflow"),$created); +$form->add(i18n("Workflow name", "cl-workflow"),formGenerateField("text","wfname",$name,40,255)); +$form->add(i18n("Description", "cl-workflow"),formGenerateField("textbox","wfdescription",$description,50,10)); +$form->add(i18n("Author", "cl-workflow"),$author); +$form->add(i18n("Created", "cl-workflow"),$created); $page = new UI_Page; $page->setContent($form->render(true)); diff --git a/includes/include.workflow_left_top.php b/includes/include.workflow_left_top.php index 7218630..394f706 100644 --- a/includes/include.workflow_left_top.php +++ b/includes/include.workflow_left_top.php @@ -34,7 +34,7 @@ if(!defined('CON_FRAMEWORK')) { $create = new Link; $create->setMultiLink("workflow","","workflow_common","workflow_create"); //$create->setCLink("workflow_common",4,"workflow_create"); -$create->setContent(i18n("Create workflow", "workflow")); +$create->setContent(i18n("Create workflow", "cl-workflow")); $create->setCustom("idworkflow","-1"); $aAttributes = array(); diff --git a/includes/include.workflow_list.php b/includes/include.workflow_list.php index a601725..fdb4332 100644 --- a/includes/include.workflow_list.php +++ b/includes/include.workflow_list.php @@ -1,4 +1,5 @@ delete($idworkflow); +if ($action == "workflow_delete") { + $workflows->delete($idworkflow); $sScript = ''; } @@ -56,31 +53,29 @@ if ($action == "workflow_delete") $ui = new UI_Menu; $workflows->select("idclient = '$client' AND idlang = '$lang'"); -while ($workflow = $workflows->next()) -{ - $wfid = $workflow->getField("idworkflow"); - $wfname = $workflow->getField("name"); - $wfdescription = $workflow->getField("description"); - - /* Create the link to show/edit the workflow */ - $link = new Link; - $link->setMultiLink("workflow","","workflow_common","workflow_show"); - $link->setAlt($wfdescription); - $link->setCustom("idworkflow",$wfid); +while ($workflow = $workflows->next()) { + $wfid = $workflow->getField("idworkflow"); + $wfname = $workflow->getField("name"); + $wfdescription = $workflow->getField("description"); - $delTitle = i18n("Delete workflow", "workflow"); - $delDescr = sprintf(i18n("Do you really want to delete the following workflow:

%s
", "workflow"),$wfname); - $delete = ''.$delTitle.''; - - $ui->setTitle($wfid, $wfname); - $ui->setLink($wfid, $link); - - $ui->setActions($wfid, 'delete', $delete); - - if ($wfid == $iIdMarked) { - $ui->setExtra ($wfid, 'id="marked" '); - } - + /* Create the link to show/edit the workflow */ + $link = new Link; + $link->setMultiLink("workflow", "", "workflow_common", "workflow_show"); + $link->setAlt($wfdescription); + $link->setCustom("idworkflow", $wfid); + + $delTitle = i18n("Delete workflow", "cl-workflow"); + $delDescr = sprintf(i18n("Do you really want to delete the following workflow:

%s
", "cl-workflow"), $wfname); + $delete = '' . $delTitle . ''; + + $ui->setTitle($wfid, $wfname); + $ui->setLink($wfid, $link); + + $ui->setActions($wfid, 'delete', $delete); + + if ($wfid == $iIdMarked) { + $ui->setExtra($wfid, 'id="marked" '); + } } $content = $ui->render(false); @@ -91,7 +86,7 @@ $delScript = ' function foo(){return true;} /* Session-ID */ - var sid = "'.$sess->id.'"; + var sid = "' . $sess->id . '"; /* Create messageBox instance */ @@ -110,20 +105,18 @@ $delScript = ' } '; - + $sInitRowMark = ""; -$msgboxInclude = ' '; +$msgboxInclude = ' '; $page = new UI_Page; $page->addScript('include', $msgboxInclude); -$page->addScript('del',$delScript); +$page->addScript('del', $delScript); $page->addScript('refresh', $sScript); $page->setMargin(0); -$page->setContent($content.$sInitRowMark); -$page->render(); - -?> \ No newline at end of file +$page->setContent($content . $sInitRowMark); +$page->render(); \ No newline at end of file diff --git a/includes/include.workflow_steps.php b/includes/include.workflow_steps.php index 32d43c1..51c39f4 100644 --- a/includes/include.workflow_steps.php +++ b/includes/include.workflow_steps.php @@ -1,4 +1,5 @@ swap($idworkflow, $position, $position -1); + $workflowitems = new WorkflowItems; + $workflowitems->swap($idworkflow, $position, $position - 1); } /* Function: Move step down */ if ($action == "workflow_step_down") { - $workflowitems= new WorkflowItems; - $workflowitems->swap($idworkflow, $position, $position +1); + $workflowitems = new WorkflowItems; + $workflowitems->swap($idworkflow, $position, $position + 1); } /* Function: Move user up */ if ($action == "workflow_user_up") { - $workflowitems= new WorkflowUserSequences; - $workflowitems->swap($idworkflowitem, $position, $position -1); + $workflowitems = new WorkflowUserSequences; + $workflowitems->swap($idworkflowitem, $position, $position - 1); } /* Function: Move step down */ if ($action == "workflow_user_down") { - $workflowitems= new WorkflowUserSequences; - $workflowitems->swap($idworkflowitem, $position, $position +1); + $workflowitems = new WorkflowUserSequences; + $workflowitems->swap($idworkflowitem, $position, $position + 1); } /* Function: Create new step */ if ($action == "workflow_create_step") { - $workflowitems= new WorkflowItems; - $item= $workflowitems->create($idworkflow); - $item->set("name", i18n("New Workflow Step", "workflow")); - $item->store(); - $idworkflowitem= $item->get("idworkflowitem"); + $workflowitems = new WorkflowItems; + $item = $workflowitems->create($idworkflow); + $item->set("name", i18n("New Workflow Step", "cl-workflow")); + $item->store(); + $idworkflowitem = $item->get("idworkflowitem"); } /* Function: Delete step */ if ($action == "workflow_step_delete") { - $workflowitems= new WorkflowItems; - $workflowitems->delete($idworkflowitem); + $workflowitems = new WorkflowItems; + $workflowitems->delete($idworkflowitem); } /* Function: Add user */ if ($action == "workflow_create_user") { - $workflowusers= new WorkflowUserSequences; - $new= $workflowusers->create($idworkflowitem); + $workflowusers = new WorkflowUserSequences; + $new = $workflowusers->create($idworkflowitem); } /* Function: Remove user */ if ($action == "workflow_user_delete") { - $workflowusers= new WorkflowUserSequences; - $workflowusers->delete($idusersequence); + $workflowusers = new WorkflowUserSequences; + $workflowusers->delete($idusersequence); } /* Function: Save step */ if ($action == "workflow_save_step" || $action == "workflow_create_user") { - $workflowactions= new WorkflowActions; + $workflowactions = new WorkflowActions; - foreach ($availableWorkflowActions as $key => $value) { - if ($wfactions[$key] == 1) { - $workflowactions->set($idworkflowitem, $key); - } else { - $workflowactions->remove($idworkflowitem, $key); - } - } + foreach ($availableWorkflowActions as $key => $value) { + if ($wfactions[$key] == 1) { + $workflowactions->set($idworkflowitem, $key); + } else { + $workflowactions->remove($idworkflowitem, $key); + } + } - $workflowitem= new WorkflowItem; - $workflowitem->loadByPrimaryKey($idworkflowitem); - $workflowitem->setField('idtask', $wftaskselect); - $workflowitem->setField('name', $wfstepname); - $workflowitem->setField('description', $wfstepdescription); - $workflowitem->store(); + $workflowitem = new WorkflowItem; + $workflowitem->loadByPrimaryKey($idworkflowitem); + $workflowitem->setField('idtask', $wftaskselect); + $workflowitem->setField('name', $wfstepname); + $workflowitem->setField('description', $wfstepdescription); + $workflowitem->store(); - $usersequences= new WorkflowUserSequences; - $usersequences->select("idworkflowitem = '$idworkflowitem'"); + $usersequences = new WorkflowUserSequences; + $usersequences->select("idworkflowitem = '$idworkflowitem'"); - while ($usersequence= $usersequences->next()) { - $wftime= "time" . $usersequence->get("idusersequence"); - $wfuser= "user" . $usersequence->get("idusersequence"); + while ($usersequence = $usersequences->next()) { + $wftime = "time" . $usersequence->get("idusersequence"); + $wfuser = "user" . $usersequence->get("idusersequence"); - $wftimelimit= "wftimelimit" . $usersequence->get("idusersequence"); - $usersequence->set("timeunit", $$wftime); - $usersequence->set("iduser", $$wfuser); - $usersequence->set("timelimit", $$wftimelimit); - $usersequence->set("emailnoti", $wfemailnoti[$usersequence->get("idusersequence")]); - $usersequence->set("escalationnoti", $wfescalnoti[$usersequence->get("idusersequence")]); - $usersequence->store(); - - } + $wftimelimit = "wftimelimit" . $usersequence->get("idusersequence"); + $usersequence->set("timeunit", $$wftime); + $usersequence->set("iduser", $$wfuser); + $usersequence->set("timelimit", $$wftimelimit); + $usersequence->set("emailnoti", $wfemailnoti[$usersequence->get("idusersequence")]); + $usersequence->set("escalationnoti", $wfescalnoti[$usersequence->get("idusersequence")]); + $usersequence->store(); + } } function getTimeUnitSelector($listid, $default) { - global $idclient, $cfg, $auth; + global $idclient, $cfg, $auth; - $timeunits = array (); - $timeunits['Seconds'] = i18n("Seconds", "workflow"); - $timeunits['Minutes'] = i18n("Minutes", "workflow"); - $timeunits['Hours'] = i18n("Hours", "workflow"); - $timeunits['Days'] = i18n("Days", "workflow"); - $timeunits['Weeks'] = i18n("Weeks", "workflow"); - $timeunits['Months'] = i18n("Months", "workflow"); - $timeunits['Years'] = i18n("Years", "workflow"); + $timeunits = array(); + $timeunits['Seconds'] = i18n("Seconds", "cl-workflow"); + $timeunits['Minutes'] = i18n("Minutes", "cl-workflow"); + $timeunits['Hours'] = i18n("Hours", "cl-workflow"); + $timeunits['Days'] = i18n("Days", "cl-workflow"); + $timeunits['Weeks'] = i18n("Weeks", "cl-workflow"); + $timeunits['Months'] = i18n("Months", "cl-workflow"); + $timeunits['Years'] = i18n("Years", "cl-workflow"); - $tpl2= new Template; - $tpl2->set('s', 'NAME', 'time' . $listid); - $tpl2->set('s', 'CLASS', 'text_small'); - $tpl2->set('s', 'OPTIONS', 'size=1'); + $tpl2 = new Template; + $tpl2->set('s', 'NAME', 'time' . $listid); + $tpl2->set('s', 'CLASS', 'text_small'); + $tpl2->set('s', 'OPTIONS', 'size=1'); - foreach ($timeunits as $key => $value) { + foreach ($timeunits as $key => $value) { - $tpl2->set('d', 'VALUE', $key); - $tpl2->set('d', 'CAPTION', $value); + $tpl2->set('d', 'VALUE', $key); + $tpl2->set('d', 'CAPTION', $value); - if ($default == $key) { - $tpl2->set('d', 'SELECTED', 'SELECTED'); - } else { - $tpl2->set('d', 'SELECTED', ''); - } + if ($default == $key) { + $tpl2->set('d', 'SELECTED', 'SELECTED'); + } else { + $tpl2->set('d', 'SELECTED', ''); + } - $tpl2->next(); - } - - return $tpl2->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true); + $tpl2->next(); + } + return $tpl2->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true); } function getWorkflowList() { - global $idworkflow, $cfg; + global $idworkflow, $cfg; - $ui= new UI_Menu; - $workflowitems= new WorkflowItems; + $ui = new UI_Menu; + $workflowitems = new WorkflowItems; - $workflowitems->select("idworkflow = '$idworkflow'", "", "position ASC"); + $workflowitems->select("idworkflow = '$idworkflow'", "", "position ASC"); - while ($workflowitem= $workflowitems->next()) { - $pos= $workflowitem->get("position"); - $name= $workflowitem->get("name"); - $id= $workflowitem->get("idworkflowitem"); + while ($workflowitem = $workflowitems->next()) { + $pos = $workflowitem->get("position"); + $name = $workflowitem->get("name"); + $id = $workflowitem->get("idworkflowitem"); - $edititem= new Link; - $edititem->setCLink("workflow_steps", 4, "workflow_step_edit"); - $edititem->setCustom("idworkflowitem", $id); - $edititem->setCustom("idworkflow", $idworkflow); + $edititem = new Link; + $edititem->setCLink("workflow_steps", 4, "workflow_step_edit"); + $edititem->setCustom("idworkflowitem", $id); + $edititem->setCustom("idworkflow", $idworkflow); - $moveup= new Link; - $moveup->setCLink("workflow_steps", 4, "workflow_step_up"); - $moveup->setCustom("idworkflowitem", $id); - $moveup->setCustom("idworkflow", $idworkflow); - $moveup->setCustom("position", $pos); - $moveup->setAlt(i18n("Move step up", "workflow")); - $moveup->setContent(''); + $moveup = new Link; + $moveup->setCLink("workflow_steps", 4, "workflow_step_up"); + $moveup->setCustom("idworkflowitem", $id); + $moveup->setCustom("idworkflow", $idworkflow); + $moveup->setCustom("position", $pos); + $moveup->setAlt(i18n("Move step up", "cl-workflow")); + $moveup->setContent(''); - $movedown= new Link; - $movedown->setCLink("workflow_steps", 4, "workflow_step_down"); - $movedown->setCustom("idworkflowitem", $id); - $movedown->setCustom("idworkflow", $idworkflow); - $movedown->setCustom("position", $pos); - $movedown->setAlt(i18n("Move step down", "workflow")); - $movedown->setContent(''); - - - - $deletestep= new Link; - $deletestep->setCLink("workflow_steps", 4, "workflow_step_delete"); - $deletestep->setCustom("idworkflowitem", $id); - $deletestep->setCustom("idworkflow", $idworkflow); - $deletestep->setCustom("position", $pos); - $deletestep->setAlt(i18n("Delete step", "workflow")); - $deletestep->setContent(''); - - $ui->setTitle($id, "$pos. $name"); - $ui->setLink($id, $edititem); - - if ($pos > 1) { - $ui->setActions($id, "moveup", $moveup->render()); - } else { - $ui->setActions($id, "moveup", ''); - } - - if ($pos < $workflowitems->count()) { - $ui->setActions($id, "movedown", $movedown->render()); - } else { - $ui->setActions($id, "movedown", ''); - } - - $ui->setActions($id, "delete", $deletestep->render()); - - if ($_GET['idworkflowitem'] == $id) { - $ui->setExtra ($id, 'id="marked" '); - } - } + $movedown = new Link; + $movedown->setCLink("workflow_steps", 4, "workflow_step_down"); + $movedown->setCustom("idworkflowitem", $id); + $movedown->setCustom("idworkflow", $idworkflow); + $movedown->setCustom("position", $pos); + $movedown->setAlt(i18n("Move step down", "cl-workflow")); + $movedown->setContent(''); - $content= $ui->render(false); - return ($content); + $deletestep = new Link; + $deletestep->setCLink("workflow_steps", 4, "workflow_step_delete"); + $deletestep->setCustom("idworkflowitem", $id); + $deletestep->setCustom("idworkflow", $idworkflow); + $deletestep->setCustom("position", $pos); + $deletestep->setAlt(i18n("Delete step", "cl-workflow")); + $deletestep->setContent(''); + + $ui->setTitle($id, "$pos. $name"); + $ui->setLink($id, $edititem); + + if ($pos > 1) { + $ui->setActions($id, "moveup", $moveup->render()); + } else { + $ui->setActions($id, "moveup", ''); + } + + if ($pos < $workflowitems->count()) { + $ui->setActions($id, "movedown", $movedown->render()); + } else { + $ui->setActions($id, "movedown", ''); + } + + $ui->setActions($id, "delete", $deletestep->render()); + + if ($_GET['idworkflowitem'] == $id) { + $ui->setExtra($id, 'id="marked" '); + } + } + + + $content = $ui->render(false); + + return ($content); } function createNewWorkflow() { - global $idworkflow, $cfg; - $content= ""; - $ui= new UI_Menu; - $rowmark = false; + global $idworkflow, $cfg; + $content = ""; + $ui = new UI_Menu; + $rowmark = false; - $createstep= new Link; - $createstep->setCLink("workflow_steps", 4, "workflow_create_step"); - $createstep->setCustom("idworkflow", $idworkflow); + $createstep = new Link; + $createstep->setCLink("workflow_steps", 4, "workflow_create_step"); + $createstep->setCustom("idworkflow", $idworkflow); - #$ui->setLink("spacer", NULL); - $ui->setTitle("create", i18n("Create new step", "workflow")); - $ui->setImage("create", $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_new.gif"); - $ui->setLink("create", $createstep); - $ui->setRowmark ($rowmark); - $ui->setBgColor("create", $cfg['color']['table_header']); - - $content= $ui->render(false); - return $content; + #$ui->setLink("spacer", NULL); + $ui->setTitle("create", i18n("Create new step", "cl-workflow")); + $ui->setImage("create", $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_new.gif"); + $ui->setLink("create", $createstep); + $ui->setRowmark($rowmark); + $ui->setBgColor("create", $cfg['color']['table_header']); + $content = $ui->render(false); + return $content; } function editWorkflowStep($idworkflowitem) { - global $area, $idworkflow, $idworkflowitem, $frame, $availableWorkflowActions; - global $notification; - $workflowitem= new WorkflowItem; + global $area, $idworkflow, $idworkflowitem, $frame, $availableWorkflowActions; + global $notification; + $workflowitem = new WorkflowItem; - if ($workflowitem->loadByPrimaryKey($idworkflowitem) == false) { - return " "; - } + if ($workflowitem->loadByPrimaryKey($idworkflowitem) == false) { + return " "; + } - $workflowactions= new WorkflowActions; + $workflowactions = new WorkflowActions; - $stepname= $workflowitem->get("name"); - $stepdescription= $workflowitem->get("description"); - $id= $workflowitem->get("idworkflowitem"); - $task= $workflowitem->get("idtask"); + $stepname = $workflowitem->get("name"); + $stepdescription = $workflowitem->get("description"); + $id = $workflowitem->get("idworkflowitem"); + $task = $workflowitem->get("idtask"); - $form= new UI_Table_Form("workflow_edit"); + $form = new UI_Table_Form("workflow_edit"); - $form->setVar("area", $area); - $form->setVar("action", "workflow_save_step"); - $form->setVar("idworkflow", $idworkflow); - $form->setVar("idworkflowitem", $idworkflowitem); - $form->setVar("frame", $frame); + $form->setVar("area", $area); + $form->setVar("action", "workflow_save_step"); + $form->setVar("idworkflow", $idworkflow); + $form->setVar("idworkflowitem", $idworkflowitem); + $form->setVar("frame", $frame); - $form->addHeader(i18n("Edit workflow step", "workflow")); - $form->add(i18n("Step name", "workflow"), formGenerateField("text", "wfstepname", $stepname, 40, 255)); - $form->add(i18n("Step description", "workflow"), formGenerateField("textbox", "wfstepdescription", $stepdescription, 60, 10)); + $form->addHeader(i18n("Edit workflow step", "cl-workflow")); + $form->add(i18n("Step name", "cl-workflow"), formGenerateField("text", "wfstepname", $stepname, 40, 255)); + $form->add(i18n("Step description", "cl-workflow"), formGenerateField("textbox", "wfstepdescription", $stepdescription, 60, 10)); - foreach ($availableWorkflowActions as $key => $value) { - $actions .= formGenerateCheckbox("wfactions[" . $key . "]", "1", $workflowactions->get($id, $key)) . '' . "
"; - } + foreach ($availableWorkflowActions as $key => $value) { + $actions .= formGenerateCheckbox("wfactions[" . $key . "]", "1", $workflowactions->get($id, $key)) . '' . "
"; + } - $form->add(i18n("Actions", "workflow"), $actions); - $form->add(i18n("Assigned users", "workflow"), getWorkflowUsers($idworkflowitem)); + $form->add(i18n("Actions", "cl-workflow"), $actions); + $form->add(i18n("Assigned users", "cl-workflow"), getWorkflowUsers($idworkflowitem)); - return $form->render(true); + return $form->render(true); } function getWorkflowUsers($idworkflowitem) { - global $idworkflow, $cfg; + global $idworkflow, $cfg; - $ui= new UI_Menu; - $workflowusers= new WorkflowUserSequences; + $ui = new UI_Menu; + $workflowusers = new WorkflowUserSequences; - $workflowusers->select("idworkflowitem = '$idworkflowitem'", "", "position ASC"); + $workflowusers->select("idworkflowitem = '$idworkflowitem'", "", "position ASC"); - while ($workflowitem= $workflowusers->next()) { - $pos= $workflowitem->get("position"); - $iduser= $workflowitem->get("iduser"); - $timelimit= $workflowitem->get("timelimit"); - $timeunit= $workflowitem->get("timeunit"); - $email= $workflowitem->get("emailnoti"); - $escalation= $workflowitem->get("escalationnoti"); - $timeunit= $workflowitem->get("timeunit"); - $id= $workflowitem->get("idusersequence"); + while ($workflowitem = $workflowusers->next()) { + $pos = $workflowitem->get("position"); + $iduser = $workflowitem->get("iduser"); + $timelimit = $workflowitem->get("timelimit"); + $timeunit = $workflowitem->get("timeunit"); + $email = $workflowitem->get("emailnoti"); + $escalation = $workflowitem->get("escalationnoti"); + $timeunit = $workflowitem->get("timeunit"); + $id = $workflowitem->get("idusersequence"); - $moveup= new Link; - $moveup->setCLink("workflow_steps", 4, "workflow_user_up"); - $moveup->setCustom("idworkflowitem", $idworkflowitem); - $moveup->setCustom("idworkflow", $idworkflow); - $moveup->setCustom("position", $pos); - $moveup->setAlt(i18n("Move user up", "workflow")); - #$moveup->setContent(''); - $moveup->setContent(''); + $moveup = new Link; + $moveup->setCLink("workflow_steps", 4, "workflow_user_up"); + $moveup->setCustom("idworkflowitem", $idworkflowitem); + $moveup->setCustom("idworkflow", $idworkflow); + $moveup->setCustom("position", $pos); + $moveup->setAlt(i18n("Move user up", "cl-workflow")); + #$moveup->setContent(''); + $moveup->setContent(''); - $movedown= new Link; - $movedown->setCLink("workflow_steps", 4, "workflow_user_down"); - $movedown->setCustom("idworkflowitem", $idworkflowitem); - $movedown->setCustom("idworkflow", $idworkflow); - $movedown->setCustom("position", $pos); - $movedown->setAlt(i18n("Move user down", "workflow")); - $movedown->setContent(''); + $movedown = new Link; + $movedown->setCLink("workflow_steps", 4, "workflow_user_down"); + $movedown->setCustom("idworkflowitem", $idworkflowitem); + $movedown->setCustom("idworkflow", $idworkflow); + $movedown->setCustom("position", $pos); + $movedown->setAlt(i18n("Move user down", "cl-workflow")); + $movedown->setContent(''); - $deletestep= new Link; - $deletestep->setCLink("workflow_steps", 4, "workflow_user_delete"); - $deletestep->setCustom("idworkflowitem", $idworkflowitem); - $deletestep->setCustom("idworkflow", $idworkflow); - $deletestep->setCustom("position", $pos); - $deletestep->setCustom("idusersequence", $id); - $deletestep->setAlt(i18n("Delete user", "workflow")); - $deletestep->setContent(''); + $deletestep = new Link; + $deletestep->setCLink("workflow_steps", 4, "workflow_user_delete"); + $deletestep->setCustom("idworkflowitem", $idworkflowitem); + $deletestep->setCustom("idworkflow", $idworkflow); + $deletestep->setCustom("position", $pos); + $deletestep->setCustom("idusersequence", $id); + $deletestep->setAlt(i18n("Delete user", "cl-workflow")); + $deletestep->setContent(''); - $title= "$pos. " . getUsers($id, $iduser); - $title .= formGenerateField("text", "wftimelimit" . $id, $timelimit, 3, 6); - $title .= getTimeUnitSelector($id, $timeunit); - $altmail= i18n("Notify this user via E-Mail", "workflow"); - $altnoti= i18n("Escalate to this user via E-Mail", "workflow"); - $title .= formGenerateCheckbox("wfemailnoti[" . $id . "]", "1", $email) . ''; - $title .= formGenerateCheckbox("wfescalnoti[" . $id . "]", "1", $escalation) . ''; + $title = "$pos. " . getUsers($id, $iduser); + $title .= formGenerateField("text", "wftimelimit" . $id, $timelimit, 3, 6); + $title .= getTimeUnitSelector($id, $timeunit); + $altmail = i18n("Notify this user via E-Mail", "cl-workflow"); + $altnoti = i18n("Escalate to this user via E-Mail", "cl-workflow"); + $title .= formGenerateCheckbox("wfemailnoti[" . $id . "]", "1", $email) . ''; + $title .= formGenerateCheckbox("wfescalnoti[" . $id . "]", "1", $escalation) . ''; - $ui->setTitle($id, $title); - $ui->setLink($id, NULL); + $ui->setTitle($id, $title); + $ui->setLink($id, NULL); - if ($pos > 1) { - $ui->setActions($id, "moveup", $moveup->render()); - } else { - $ui->setActions($id, "moveup", ''); - } + if ($pos > 1) { + $ui->setActions($id, "moveup", $moveup->render()); + } else { + $ui->setActions($id, "moveup", ''); + } - if ($pos < $workflowusers->count()) { - $ui->setActions($id, "movedown", $movedown->render()); - } else { - $ui->setActions($id, "movedown", ''); - } + if ($pos < $workflowusers->count()) { + $ui->setActions($id, "movedown", $movedown->render()); + } else { + $ui->setActions($id, "movedown", ''); + } - $ui->setActions($id, "delete", $deletestep->render()); + $ui->setActions($id, "delete", $deletestep->render()); - $ui->setImage($id, $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_user.gif"); + $ui->setImage($id, $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_user.gif"); + } - } + $createstep = new Link; + $createstep->setCLink("workflow_steps", 4, "workflow_create_user"); + $createstep->setCustom("idworkflow", $idworkflow); + $createstep->setCustom("idworkflowitem", $idworkflowitem); - $createstep= new Link; - $createstep->setCLink("workflow_steps", 4, "workflow_create_user"); - $createstep->setCustom("idworkflow", $idworkflow); - $createstep->setCustom("idworkflowitem", $idworkflowitem); + $ui->setLink("spacer", NULL); - $ui->setLink("spacer", NULL); + $ui->setTitle("create", ''); + $ui->setLink("create", NULL); + $content = $ui->render(false); - $ui->setTitle("create", ''); - $ui->setLink("create", NULL); - $content= $ui->render(false); - - return ($content); + return ($content); } -$tpl= new Template; +$tpl = new Template; $tpl->set('s', 'NEW', createNewWorkflow()); $tpl->set('s', 'STEPS', getWorkflowList()); $tpl->set('s', 'EDITSTEP', editWorkflowStep($idworkflowitem)); $tpl->set('s', 'BORDERCOLOR', $cfg["color"]["table_border"]); -$frame= $tpl->generate($cfg["path"]["contenido"] . $cfg["path"]["plugins"] . "workflow/templates/template.workflow_steps.html", true); +$frame = $tpl->generate($cfg["path"]["contenido"] . $cfg["path"]["plugins"] . "workflow/templates/template.workflow_steps.html", true); -$page= new UI_Page; +$page = new UI_Page; $page->setContent($frame); $page->render(); -?> diff --git a/includes/include.workflow_subnav.php b/includes/include.workflow_subnav.php index de7e964..6b70c1a 100644 --- a/includes/include.workflow_subnav.php +++ b/includes/include.workflow_subnav.php @@ -1,4 +1,5 @@ query($sql); +$db->query($sql); - $in_str = ""; +$in_str = ""; - while ( $db->next_record() ) { - $in_str .= $db->f('idarea') . ','; - } +while ($db->next_record()) { + $in_str .= $db->f('idarea') . ','; +} - $len = strlen($in_str)-1; - $in_str = substr($in_str, 0, $len); - $in_str = '('.$in_str.')'; +$len = strlen($in_str) - 1; +$in_str = substr($in_str, 0, $len); +$in_str = '(' . $in_str . ')'; - $sql = "SELECT +$sql = "SELECT b.location AS location, a.name AS name FROM - ".$cfg["tab"]["area"]." AS a, - ".$cfg["tab"]["nav_sub"]." AS b + " . $cfg["tab"]["area"] . " AS a, + " . $cfg["tab"]["nav_sub"] . " AS b WHERE - b.idarea IN ".Contenido_Security::escapeDB($in_str, $db)." AND + b.idarea IN " . Contenido_Security::escapeDB($in_str, $db) . " AND b.idarea = a.idarea AND b.level = 1 ORDER BY b.idnavs"; - $db->query($sql); +$db->query($sql); - while ( $db->next_record() ) { +while ($db->next_record()) { - # Extract caption from - # the xml language file - $caption = $nav->getName($db->f("location")); + # Extract caption from + # the xml language file + $caption = $nav->getName($db->f("location")); - $tmp_area = $db->f("name"); - - # Set template data - $tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt); - $tpl->set("d", "CLASS", ''); - $tpl->set("d", "OPTIONS", ''); - $tpl->set("d", "CAPTION", ''.$caption.''); - if ($area == $tmp_area) - { - $tpl->set('s', 'DEFAULT', markSubMenuItem($tpl->dyn_cnt,true)); - } - $tpl->next(); + $tmp_area = $db->f("name"); + # Set template data + $tpl->set("d", "ID", 'c_' . $tpl->dyn_cnt); + $tpl->set("d", "CLASS", ''); + $tpl->set("d", "OPTIONS", ''); + $tpl->set("d", "CAPTION", '' . $caption . ''); + if ($area == $tmp_area) { + $tpl->set('s', 'DEFAULT', markSubMenuItem($tpl->dyn_cnt, true)); } + $tpl->next(); +} - $tpl->set('s', 'COLSPAN', ($tpl->dyn_cnt * 2) + 2); - $tpl->set('s', 'IDCAT', $idcat); - $tpl->set('s', 'SESSID', $sess->id); - $tpl->set('s', 'CLIENT', $client); - $tpl->set('s', 'LANG', $lang); - - - # Generate the third - # navigation layer - if ($idworkflow <= 0) - { - $tpl->generate($cfg["path"]["templates"].$cfg["templates"]["subnav_blank"]); - } else { - $tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav"]); - } +$tpl->set('s', 'COLSPAN', ($tpl->dyn_cnt * 2) + 2); +$tpl->set('s', 'IDCAT', $idcat); +$tpl->set('s', 'SESSID', $sess->id); +$tpl->set('s', 'CLIENT', $client); +$tpl->set('s', 'LANG', $lang); -?> +# Generate the third +# navigation layer +if ($idworkflow <= 0) { + $tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav_blank"]); +} else { + $tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav"]); +} \ No newline at end of file diff --git a/includes/include.workflow_tasks.php b/includes/include.workflow_tasks.php index 0c524f8..3b450f9 100644 --- a/includes/include.workflow_tasks.php +++ b/includes/include.workflow_tasks.php @@ -1,4 +1,5 @@ auth["uid"]; +if ($usershow == "") { + $usershow = $auth->auth["uid"]; } -if (!$perm->have_perm_area_action($area, "workflow_task_user_select")) -{ - $usershow = $auth->auth["uid"]; +if (!$perm->have_perm_area_action($area, "workflow_task_user_select")) { + $usershow = $auth->auth["uid"]; } -if ($action == "workflow_do_action") -{ - $selectedAction = "wfselect".$modidartlang; +if ($action == "workflow_do_action") { + $selectedAction = "wfselect" . $modidartlang; doWorkflowAction($modidartlang, $GLOBALS[$selectedAction]); } $wfa->select(); -while ($wfaitem = $wfa->next()) -{ - $wfaid = $wfaitem->get("idartallocation"); - $usersequence[$wfaid] = $wfaitem->get("idusersequence"); - $lastusersequence[$wfaid] = $wfaitem->get("lastusersequence"); - $article[$wfaid] = $wfaitem->get("idartlang"); -} - - -if (is_array($usersequence)) -{ -foreach ($usersequence as $key => $value) -{ - $wfu->select("idusersequence = '$value'"); - if ($obj = $wfu->next()) - { - $userids[$key] = $obj->get("iduser"); - } -} +while ($wfaitem = $wfa->next()) { + $wfaid = $wfaitem->get("idartallocation"); + $usersequence[$wfaid] = $wfaitem->get("idusersequence"); + $lastusersequence[$wfaid] = $wfaitem->get("lastusersequence"); + $article[$wfaid] = $wfaitem->get("idartlang"); } -if (is_array($userids)) -{ -foreach ($userids as $key=>$value) -{ - $isCurrent[$key] = false; - - if ($usershow == $value) - { - $isCurrent[$key] = true; - } - - if ($users->loadUserByUserID($value) == false) - { - /* Yes, it's a group. Let's try to load the group members! */ - $sql = "SELECT user_id FROM " - .$cfg["tab"]["groupmembers"]." - WHERE group_id = '".$value."'"; - $db2->query(Contenido_Security::escapeDB($sql, $db2)); - - while ($db2->next_record()) - { - if ($db2->f("user_id") == $usershow) - { - $isCurrent[$key] = true; - } + +if (is_array($usersequence)) { + foreach ($usersequence as $key => $value) { + $wfu->select("idusersequence = '$value'"); + if ($obj = $wfu->next()) { + $userids[$key] = $obj->get("iduser"); } - } else { - if ($value == $usershow) - { - $isCurrent[$key] = true; - } - } - - if ($lastusersequence[$key] == $usersequence[$key]) - { - $isCurrent[$key] = false; } } + +if (is_array($userids)) { + foreach ($userids as $key => $value) { + $isCurrent[$key] = false; + + if ($usershow == $value) { + $isCurrent[$key] = true; + } + + if ($users->loadUserByUserID($value) == false) { + /* Yes, it's a group. Let's try to load the group members! */ + $sql = "SELECT user_id FROM " + . $cfg["tab"]["groupmembers"] . " + WHERE group_id = '" . $value . "'"; + $db2->query(Contenido_Security::escapeDB($sql, $db2)); + + while ($db2->next_record()) { + if ($db2->f("user_id") == $usershow) { + $isCurrent[$key] = true; + } + } + } else { + if ($value == $usershow) { + $isCurrent[$key] = true; + } + } + + if ($lastusersequence[$key] == $usersequence[$key]) { + $isCurrent[$key] = false; + } + } } $tpl->reset(); @@ -130,136 +113,131 @@ $tpl->set('s', 'SESSNAME', $sess->name); $iIDCat = 0; $iIDTpl = 0; -if ($perm->have_perm_area_action($area, "workflow_task_user_select")) -{ +if ($perm->have_perm_area_action($area, "workflow_task_user_select")) { $form = new UI_Form("showusers", $sess->url("main.php?area=$area&frame=$frame")); - $form->setVar("area",$area); + $form->setVar("area", $area); $form->setEvent("submit", "setUsershow();"); $form->setVar("frame", $frame); $form->setVar("action", "workflow_task_user_select"); - $form->add("select",i18n("Show users").": ".getUsers("show",$usershow)); - $form->add("button", ''); - + $form->add("select", i18n("Show users", 'cl-workflow') . ": " . getUsers("show", $usershow)); + $form->add("button", ''); + $tpl->set('s', 'USERSELECT', $form->render(true)); } else { $tpl->set('s', 'USERSELECT', ''); } -$pageTitle = i18n('Search results').' - '.i18n('Workflow tasks', 'workflow'); +$pageTitle = i18n('Search results', 'cl-workflow') . ' - ' . i18n('Workflow tasks', 'cl-workflow'); $tpl->set('s', 'PAGE_TITLE', $pageTitle); -$tpl->set('s', 'TH_START', i18n("Article")); -$tpl->set('s', 'TH_TEMPLATE', i18n("Template")); -$tpl->set('s', 'TH_ACTIONS', i18n("Actions")); -$tpl->set('s', 'TH_TITLE', i18n("Title")); -$tpl->set('s', 'TH_CHANGED', i18n("Changed")); -$tpl->set('s', 'TH_PUBLISHED', i18n("Published")); -$tpl->set('s', 'TH_WORKFLOW_STEP', i18n("Workflow Step", 'workflow')); -$tpl->set('s', 'TH_WORKFLOW_ACTION', i18n("Workflow Action", 'workflow')); -$tpl->set('s', 'TH_WORKFLOW_EDITOR', i18n("Workflow Editor")); -$tpl->set('s', 'TH_LAST_STATUS', i18n("Last status", 'workflow')); +$tpl->set('s', 'TH_START', i18n("Article", 'cl-workflow')); +$tpl->set('s', 'TH_TEMPLATE', i18n("Template", 'cl-workflow')); +$tpl->set('s', 'TH_ACTIONS', i18n("Actions", 'cl-workflow')); +$tpl->set('s', 'TH_TITLE', i18n("Title", 'cl-workflow')); +$tpl->set('s', 'TH_CHANGED', i18n("Changed", 'cl-workflow')); +$tpl->set('s', 'TH_PUBLISHED', i18n("Published", 'cl-workflow')); +$tpl->set('s', 'TH_WORKFLOW_STEP', i18n("Workflow Step", 'cl-workflow')); +$tpl->set('s', 'TH_WORKFLOW_ACTION', i18n("Workflow Action", 'cl-workflow')); +$tpl->set('s', 'TH_WORKFLOW_EDITOR', i18n("Workflow Editor", 'cl-workflow')); +$tpl->set('s', 'TH_LAST_STATUS', i18n("Last status", 'cl-workflow')); $currentUserSequence = new WorkflowUserSequence; - -if (is_array($isCurrent)) -{ -foreach ($isCurrent as $key => $value) -{ - if ($value == true) - { - $idartlang = Contenido_Security::toInteger($article[$key]); - $lang = Contenido_Security::toInteger($lang); - $client = Contenido_Security::toInteger($client); +if (is_array($isCurrent)) { - $sql = "SELECT B.idcat AS idcat, A.title AS title, A.created AS created, A.lastmodified AS changed, + foreach ($isCurrent as $key => $value) { + if ($value == true) { + $idartlang = Contenido_Security::toInteger($article[$key]); + $lang = Contenido_Security::toInteger($lang); + $client = Contenido_Security::toInteger($client); + + $sql = "SELECT B.idcat AS idcat, A.title AS title, A.created AS created, A.lastmodified AS changed, A.idart as idart, E.name as tpl_name, A.idartlang as idartlang, F.idcatlang as idcatlang, B.idcatart as idcatart, A.idlang as art_lang, F.startidartlang as startidartlang - FROM (".$cfg["tab"]["art_lang"]." AS A, - ".$cfg["tab"]["cat_art"]." AS B, - ".$cfg["tab"]["art"]." AS C) - LEFT JOIN ".$cfg['tab']['tpl_conf']." as D ON A.idtplcfg = D.idtplcfg - LEFT JOIN ".$cfg['tab']['tpl']." as E ON D.idtpl = E.`idtpl` - LEFT JOIN ".$cfg['tab']['cat_lang']." as F ON B.idcat = F.`idcat` + FROM (" . $cfg["tab"]["art_lang"] . " AS A, + " . $cfg["tab"]["cat_art"] . " AS B, + " . $cfg["tab"]["art"] . " AS C) + LEFT JOIN " . $cfg['tab']['tpl_conf'] . " as D ON A.idtplcfg = D.idtplcfg + LEFT JOIN " . $cfg['tab']['tpl'] . " as E ON D.idtpl = E.`idtpl` + LEFT JOIN " . $cfg['tab']['cat_lang'] . " as F ON B.idcat = F.`idcat` WHERE A.idartlang = '$idartlang' AND A.idart = B.idart AND A.idart = C.idart AND A.idlang = '$lang' AND C.idclient = '$client';"; - - $db->query($sql); - if ($db->next_record()) - { - global $area; - //$area = "con"; - $idcat = $db->f("idcat"); - $idart = $db->f("idart"); + $db->query($sql); - # create javascript multilink - $tmp_mstr = '%s'; + if ($db->next_record()) { + global $area; + //$area = "con"; + $idcat = $db->f("idcat"); + $idart = $db->f("idart"); - $mstr = sprintf($tmp_mstr, 'right_top', - $sess->url("main.php?area=con&frame=3&idcat=$idcat&idtpl=$idtpl"), - 'right_bottom', - $sess->url("main.php?area=con_editart&action=con_edit&frame=4&idcat=$idcat&idtpl=$idtpl&idart=$idart"), - $db->f("title")); + # create javascript multilink + $tmp_mstr = '%s'; - $laststatus = getLastWorkflowStatus($idartlang); - $username = getGroupOrUserName($userids[$key]); - $actionSelect = piworkflowRenderColumn($idcat, $idart, $db->f('idartlang'), 'wfaction'); - - $currentUserSequence->loadByPrimaryKey($usersequence[$key]); - $workflowItem = $currentUserSequence->getWorkflowItem(); - $step = $workflowItem->get("name"); - $description = $workflowItem->get("description"); - - $sRowId = $db->f('idart').'-'.$db->f('idartlang').'-'.$db->f('idcat').'-'.$db->f('idcatlang').'-'.$db->f('idcatart').'-'.$db->f('art_lang'); - - if( $db->f('startidartlang') == $db->f('idartlang') ) { - $makeStartarticle = "\"{$sFlagTitle}\""; - } else { - $makeStartarticle = "\"{$sFlagTitle}\""; + $mstr = sprintf($tmp_mstr, 'right_top', + $sess->url("main.php?area=con&frame=3&idcat=$idcat&idtpl=$idtpl"), + 'right_bottom', + $sess->url("main.php?area=con_editart&action=con_edit&frame=4&idcat=$idcat&idtpl=$idtpl&idart=$idart"), + $db->f("title")); + + $laststatus = getLastWorkflowStatus($idartlang); + $username = getGroupOrUserName($userids[$key]); + $actionSelect = piworkflowRenderColumn($idcat, $idart, $db->f('idartlang'), 'wfaction'); + + $currentUserSequence->loadByPrimaryKey($usersequence[$key]); + $workflowItem = $currentUserSequence->getWorkflowItem(); + $step = $workflowItem->get("name"); + $description = $workflowItem->get("description"); + + $sRowId = $db->f('idart') . '-' . $db->f('idartlang') . '-' . $db->f('idcat') . '-' . $db->f('idcatlang') . '-' . $db->f('idcatart') . '-' . $db->f('art_lang'); + + if ($db->f('startidartlang') == $db->f('idartlang')) { + $makeStartarticle = "\"{$sFlagTitle}\""; + } else { + $makeStartarticle = "\"{$sFlagTitle}\""; + } + + $todoListeSubject = i18n("Reminder", 'cl-workflow'); + $sReminder = i18n("Set reminder / add to todo list", 'cl-workflow'); + $sReminderHtml = "\"$sReminder\""; + + $templatename = $db->f('tpl_name'); + if (!empty($templatename)) { + $templatename = clHtmlEntities($templatename); + } else { + $templatename = '--- ' . i18n("None", 'cl-workflow') . ' ---'; + } + + if ($i == 0) { + $iIDCat = $db->f("idcat"); + $iIDTpl = $idtpl; + $tpl->set('s', 'FIRST_ROWID', $sRowId); + } + + $tpl->set('d', 'START', $makeStartarticle); + $tpl->set('d', 'TITLE', $mstr); + $tpl->set('d', 'LAST_STATUS', $laststatus); + $tpl->set('d', 'WORKFLOW_EDITOR', $username); + $tpl->set('d', 'WORKFLOW_STEP', $step); + $tpl->set('d', 'WORKFLOW_ACTION', $actionSelect); + $tpl->set('d', 'TEMPLATE', $templatename); + $tpl->set('d', 'BGCOLOR', $cfg['color']['table_dark_offline']); + $tpl->set('d', 'ROWID', $sRowId); + $tpl->set('d', 'ACTIONS', $sReminderHtml); + $tpl->next(); + $i++; } - - $todoListeSubject = i18n("Reminder"); - $sReminder = i18n("Set reminder / add to todo list"); - $sReminderHtml = "\"$sReminder\""; - - $templatename = $db->f('tpl_name'); - if (!empty($templatename)) { - $templatename = clHtmlEntities($templatename); - } else { - $templatename = '--- ' . i18n("None") . ' ---'; - } - - if ($i == 0) { - $iIDCat = $db->f("idcat"); - $iIDTpl = $idtpl; - $tpl->set('s', 'FIRST_ROWID', $sRowId); - } - - $tpl->set('d', 'START', $makeStartarticle); - $tpl->set('d', 'TITLE', $mstr); - $tpl->set('d', 'LAST_STATUS', $laststatus); - $tpl->set('d', 'WORKFLOW_EDITOR', $username); - $tpl->set('d', 'WORKFLOW_STEP', $step); - $tpl->set('d', 'WORKFLOW_ACTION', $actionSelect); - $tpl->set('d', 'TEMPLATE', $templatename); - $tpl->set('d', 'BGCOLOR', $cfg['color']['table_dark_offline']); - $tpl->set('d', 'ROWID', $sRowId); - $tpl->set('d', 'ACTIONS', $sReminderHtml); - $tpl->next(); - $i++; - } - } -} + } + } } -if ($i > 0) { +if ($i > 0) { $tpl->set('s', 'NO_ARTICLES_ROW'); } else { - $sRow = '' . i18n("No article found.") . ''; + $sRow = '' . i18n("No article found.", 'cl-workflow') . ''; $tpl->set('s', 'NO_ARTICLES_ROW', $sRow); } @@ -270,5 +248,3 @@ $frame = ob_get_contents(); ob_end_clean(); $tpl->generate($cfg["path"]['contenido'] . $cfg["path"]["plugins"] . "workflow/templates/template.workflow_tasks.html"); - -?> diff --git a/plugin_install.sql b/plugin_install.sql new file mode 100644 index 0000000..f628565 --- /dev/null +++ b/plugin_install.sql @@ -0,0 +1,11 @@ +CREATE TABLE IF NOT EXISTS !PREFIX!wf_actions ( +idworkflowaction int(10) NOT NULL auto_increment, +idworkflowitem int(10) NOT NULL default 0, +action varchar(255) NOT NULL, +PRIMARY KEY (idworkflowaction) +); +CREATE TABLE IF NOT EXISTS !PREFIX!wf_allocation (idallocation int(10) NOT NULL auto_increment, idworkflow int(10) NOT NULL default 0, idcatlang int(10) NOT NULL default 0, PRIMARY KEY (idallocation)); +CREATE TABLE IF NOT EXISTS !PREFIX!wf_art_allocation (idartallocation int(10) NOT NULL auto_increment, idartlang int(10) NOT NULL default 0, idusersequence int(10) NOT NULL default 0, starttime datetime NOT NULL, laststatus varchar(32) default NULL, lastusersequence int(10) NOT NULL default 0, PRIMARY KEY (idartallocation)); +CREATE TABLE IF NOT EXISTS !PREFIX!wf_items (idworkflowitem int(10) NOT NULL auto_increment, idworkflow int(10) NOT NULL default 0, position int(10) NOT NULL default 0, name varchar(255) NOT NULL default 0, description text NOT NULL, idtask int(10) NOT NULL default 0, PRIMARY KEY (idworkflowitem)); +CREATE TABLE IF NOT EXISTS !PREFIX!wf_user_sequences (idusersequence int(10) NOT NULL auto_increment, idworkflowitem int(10) NOT NULL default 0, iduser varchar(32) NOT NULL, position int(10) NOT NULL default 0, timelimit int(10) NOT NULL default 0, timeunit varchar(32) NOT NULL, emailnoti int(10) NOT NULL default 0, escalationnoti int(10) NOT NULL default 0, PRIMARY KEY (idusersequence)); +CREATE TABLE IF NOT EXISTS !PREFIX!wf_workflow (idworkflow int(10) NOT NULL auto_increment, idclient int(10) NOT NULL default 0, idlang int(10) NOT NULL default 0, idauthor varchar(32) NOT NULL, name varchar(255) NOT NULL, description text NOT NULL, created datetime NOT NULL, PRIMARY KEY (idworkflow)); \ No newline at end of file diff --git a/plugin_uninstall.sql b/plugin_uninstall.sql new file mode 100644 index 0000000..73cd40e --- /dev/null +++ b/plugin_uninstall.sql @@ -0,0 +1,6 @@ +DROP TABLE !PREFIX!wf_actions; +DROP TABLE !PREFIX!wf_allocation; +DROP TABLE !PREFIX!wf_art_allocation; +DROP TABLE !PREFIX!wf_items; +DROP TABLE !PREFIX!wf_user_sequences; +DROP TABLE !PREFIX!wf_workflow; \ No newline at end of file diff --git a/templates/template.workflow_steps.html b/templates/template.workflow_steps.html index a064aeb..c77def0 100644 --- a/templates/template.workflow_steps.html +++ b/templates/template.workflow_steps.html @@ -1,13 +1,13 @@
-{NEW} + {NEW}
- {STEPS} + {STEPS}
- {EDITSTEP} + {EDITSTEP}
- i18n('Warning: Changes will reset active Workflows') + i18n('Warning: Changes will reset active Workflows', 'cl-workflow')
\ No newline at end of file diff --git a/templates/template.workflow_tasks.html b/templates/template.workflow_tasks.html index 0170f66..375b235 100644 --- a/templates/template.workflow_tasks.html +++ b/templates/template.workflow_tasks.html @@ -1,34 +1,34 @@ - + - - {TITLE} - - - - - - - - - @@ -39,7 +39,7 @@
- + @@ -52,7 +52,7 @@ - + @@ -65,91 +65,93 @@ - + {NO_ARTICLES_ROW}
{TH_TEMPLATE} {TH_ACTIONS}
{START}{ACTIONS}
- - + + From f5349680263f4c221085164c8d97d936d1aa7025 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Mon, 23 Aug 2021 15:57:01 +0200 Subject: [PATCH 3/3] fixes --- includes/include.workflow_steps.php | 27 +- locale/de_DE/LC_MESSAGES/cl-workflow.mo | Bin 6602 -> 6552 bytes locale/de_DE/LC_MESSAGES/cl-workflow.po | 402 +++++++++++------------- templates/template.workflow_steps.html | 2 +- 4 files changed, 195 insertions(+), 236 deletions(-) diff --git a/includes/include.workflow_steps.php b/includes/include.workflow_steps.php index 51c39f4..fe1bfbf 100644 --- a/includes/include.workflow_steps.php +++ b/includes/include.workflow_steps.php @@ -143,7 +143,7 @@ function getTimeUnitSelector($listid, $default) { $timeunits['Months'] = i18n("Months", "cl-workflow"); $timeunits['Years'] = i18n("Years", "cl-workflow"); - $tpl2 = new Template; + $tpl2 = new Template(); $tpl2->set('s', 'NAME', 'time' . $listid); $tpl2->set('s', 'CLASS', 'text_small'); $tpl2->set('s', 'OPTIONS', 'size=1'); @@ -190,7 +190,7 @@ function getWorkflowList() { $moveup->setCustom("idworkflow", $idworkflow); $moveup->setCustom("position", $pos); $moveup->setAlt(i18n("Move step up", "cl-workflow")); - $moveup->setContent(''); + $moveup->setContent(''); $movedown = new Link; $movedown->setCLink("workflow_steps", 4, "workflow_step_down"); @@ -198,7 +198,7 @@ function getWorkflowList() { $movedown->setCustom("idworkflow", $idworkflow); $movedown->setCustom("position", $pos); $movedown->setAlt(i18n("Move step down", "cl-workflow")); - $movedown->setContent(''); + $movedown->setContent(''); @@ -208,7 +208,7 @@ function getWorkflowList() { $deletestep->setCustom("idworkflow", $idworkflow); $deletestep->setCustom("position", $pos); $deletestep->setAlt(i18n("Delete step", "cl-workflow")); - $deletestep->setContent(''); + $deletestep->setContent(''); $ui->setTitle($id, "$pos. $name"); $ui->setLink($id, $edititem); @@ -250,7 +250,7 @@ function createNewWorkflow() { #$ui->setLink("spacer", NULL); $ui->setTitle("create", i18n("Create new step", "cl-workflow")); - $ui->setImage("create", $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_new.gif"); + $ui->setImage("create", $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "cl-workflow/images/workflow_step_new.gif"); $ui->setLink("create", $createstep); $ui->setRowmark($rowmark); $ui->setBgColor("create", $cfg['color']['table_header']); @@ -322,7 +322,7 @@ function getWorkflowUsers($idworkflowitem) { $moveup->setCustom("position", $pos); $moveup->setAlt(i18n("Move user up", "cl-workflow")); #$moveup->setContent(''); - $moveup->setContent(''); + $moveup->setContent(''); $movedown = new Link; $movedown->setCLink("workflow_steps", 4, "workflow_user_down"); @@ -330,7 +330,7 @@ function getWorkflowUsers($idworkflowitem) { $movedown->setCustom("idworkflow", $idworkflow); $movedown->setCustom("position", $pos); $movedown->setAlt(i18n("Move user down", "cl-workflow")); - $movedown->setContent(''); + $movedown->setContent(''); @@ -341,15 +341,15 @@ function getWorkflowUsers($idworkflowitem) { $deletestep->setCustom("position", $pos); $deletestep->setCustom("idusersequence", $id); $deletestep->setAlt(i18n("Delete user", "cl-workflow")); - $deletestep->setContent(''); + $deletestep->setContent(''); $title = "$pos. " . getUsers($id, $iduser); $title .= formGenerateField("text", "wftimelimit" . $id, $timelimit, 3, 6); $title .= getTimeUnitSelector($id, $timeunit); $altmail = i18n("Notify this user via E-Mail", "cl-workflow"); $altnoti = i18n("Escalate to this user via E-Mail", "cl-workflow"); - $title .= formGenerateCheckbox("wfemailnoti[" . $id . "]", "1", $email) . ''; - $title .= formGenerateCheckbox("wfescalnoti[" . $id . "]", "1", $escalation) . ''; + $title .= formGenerateCheckbox("wfemailnoti[" . $id . "]", "1", $email) . ''; + $title .= formGenerateCheckbox("wfescalnoti[" . $id . "]", "1", $escalation) . ''; $ui->setTitle($id, $title); $ui->setLink($id, NULL); @@ -368,7 +368,7 @@ function getWorkflowUsers($idworkflowitem) { $ui->setActions($id, "delete", $deletestep->render()); - $ui->setImage($id, $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_user.gif"); + $ui->setImage($id, $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "cl-workflow/images/workflow_user.gif"); } $createstep = new Link; @@ -385,12 +385,13 @@ function getWorkflowUsers($idworkflowitem) { return ($content); } -$tpl = new Template; +$tpl = new Template(); +$tpl->setDomain('cl-workflow'); $tpl->set('s', 'NEW', createNewWorkflow()); $tpl->set('s', 'STEPS', getWorkflowList()); $tpl->set('s', 'EDITSTEP', editWorkflowStep($idworkflowitem)); $tpl->set('s', 'BORDERCOLOR', $cfg["color"]["table_border"]); -$frame = $tpl->generate($cfg["path"]["contenido"] . $cfg["path"]["plugins"] . "workflow/templates/template.workflow_steps.html", true); +$frame = $tpl->generate($cfg["path"]["contenido"] . $cfg["path"]["plugins"] . "cl-workflow/templates/template.workflow_steps.html", true); $page = new UI_Page; $page->setContent($frame); diff --git a/locale/de_DE/LC_MESSAGES/cl-workflow.mo b/locale/de_DE/LC_MESSAGES/cl-workflow.mo index a5ec096a6f5f0fd46ec7aa1d41e1fa03b0aeb755..20401b025e442818fde0aeb3655037b311da3c75 100644 GIT binary patch delta 816 zcmXZaJ7`m37{>88&811KZ7w#At)xlOVhWzz6pK(0yn!HS2bW}#I*FGxOF3CAx+s`I zLF(8z1Qb%U)WtQ`;G|>`Cmjlch)^hq|0g+clHd8x<^A68`A)C$qVhK2cXxbduP4pI zW_CMfmd1NHjvF|GPq2Vncm%)TJnmr-55>(EFpk&pG+x4on8#hL;9oq9`GnaNo=uo* z%xzb=ki(mp!a8c=r>OfaJc?aZqn|N=13Zr3P>uPMX49DVbnqDCi#UO|@G{;2(_Z;-t`uS7{5U!)5Q!9Pz%{dC75t& zS2xPIh&S*A*3rRNcnUwECOSYR6y;Cm_@kCBqY}A>OSp=9e;t)<8`XFp_52>Pd*n~f z5l-T$y_rMpT^`lx17zFmF)Ff`s3^BlTk!#vR1Y=r4^*RZ9#$e*RGlKK&Q&~*HROHQ zHaXEpw1tYSJ-T5XRDt)Xt@()R_&ajgZ|{1P>MM*hs0GxJkn9d>!Un4TGvr$z)~w8;@@vF$rqRkW%f3}`rf~{F6oRRUKp1K{3q`%==pAp&IEoP5MJ?Lo zW)NCL)FKEsg)W3zM9?N7bg3JmMe0J@NV~NDPu|7wJLlZF?|IL2?u*oN>O*CPzY{Wh zS8o#;>@2om753tJOk)N|@HQ@CJMLi$uf)ubU=|~o ziqs`-~gUxK81&|jCb%g z>Y!T<{=rG~Hfz=zcnzDG-^Df@MkVqbRd6ntFQ6Lyh&s`?V0|5{ng2i~vyEr4j_!1j z4pf4-dWZzLyZlbPY7nRf>)W%KxNsXpaiQGrk8AR22 zj5l!>dEd7c2KtEBP?2pMJg}dr0>4mKvybXHMm2_Z0kz(Py_i8AU=|6>UZOT!K-K?> zeCz*fX7Ln1v&H?YP;JfC*5r-uWU^cx+3M=+PGkz+m@_`<^ke| diff --git a/locale/de_DE/LC_MESSAGES/cl-workflow.po b/locale/de_DE/LC_MESSAGES/cl-workflow.po index 8a15671..b8224de 100644 --- a/locale/de_DE/LC_MESSAGES/cl-workflow.po +++ b/locale/de_DE/LC_MESSAGES/cl-workflow.po @@ -2,33 +2,19 @@ msgid "" msgstr "" "Project-Id-Version: CL-Workflow V1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-20 18:04+0200\n" -"PO-Revision-Date: 2020-08-20 18:11+0200\n" +"POT-Creation-Date: 2020-08-20 19:27+0200\n" +"PO-Revision-Date: 2020-08-21 10:53+0200\n" "Last-Translator: Ortwin Pinke \n" "Language-Team: CL-Dev \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Basepath: M:/Projekte_Persoenlich/timo.hummel/plugin_sources\n" +"X-Poedit-Basepath: ../../..\n" "X-Poedit-KeywordsList: i18n\n" "X-Generator: Poedit 2.0.6\n" "X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-SearchPath-0: workflow\n" - -#: classes/class.workflowusersequence.php:105 -msgid "Workflow item doesn't exist. Can't create entry." -msgstr "Workflow existiert nicht. Eintrag kann nicht erstellt werden." - -#: classes/class.workflowusersequence.php:129 -#: classes/class.workflowusersequence.php:137 -#: classes/class.workflowitems.php:125 classes/class.workflowitems.php:133 -msgid "Swapping items failed: Item doesn't exist" -msgstr "Tausch der Einträge fehlgeschlagen: Eintrag nicht vorhanden" - -#: classes/class.workflowusersequence.php:212 -msgid "Can't set user_id: User or group doesn't exist" -msgstr "Kann Benutzer-Id nicht zuweisen: Benutzer oder Gruppe nicht vorhanden" +"X-Poedit-SearchPath-0: .\n" #: classes/class.workflowactions.php:69 msgid "Publish article" @@ -62,9 +48,23 @@ msgstr "Template bearbeiten" msgid "Revise article" msgstr "Artikel überarbeiten" +#: classes/class.workflowallocation.php:106 +#: classes/class.workflowallocation.php:203 +msgid "Category already has a workflow assigned" +msgstr "Kategorie ist bereits Workflow zugeordnet" + +#: classes/class.workflowallocation.php:114 +#: classes/class.workflowallocation.php:181 classes/class.workflowitems.php:274 +msgid "Workflow doesn't exist" +msgstr "Workflow existiert nicht" + +#: classes/class.workflowallocation.php:212 +msgid "Category doesn't exist, assignment failed" +msgstr "Kategorie existiert nicht, Zuordnung fehlgeschlagen" + #: classes/class.workflowartallocation.php:67 msgid "Article doesn't exist" -msgstr "Artikel existiert nicht." +msgstr "Artikel existiert nicht" #: classes/class.workflowartallocation.php:74 msgid "Article is already assigned to a usersequence step." @@ -80,6 +80,12 @@ msgstr "Workflow Notifikation" msgid "Workflow escalation" msgstr "Workflow Steigerung" +#: classes/class.workflowitems.php:125 classes/class.workflowitems.php:133 +#: classes/class.workflowusersequence.php:129 +#: classes/class.workflowusersequence.php:137 +msgid "Swapping items failed: Item doesn't exist" +msgstr "Tausch der Einträge fehlgeschlagen: Eintrag nicht vorhanden" + #: classes/class.workflowitems.php:158 msgid "Can't add item to workflow: Workflow doesn't exist" msgstr "" @@ -94,100 +100,19 @@ msgstr "Kein Eintrag geladen" msgid "Requested task doesn't exist, can't assign" msgstr "Gewünschte Aufgabe existiert nicht, Zuordnung nicht möglich" -#: classes/class.workflowitems.php:274 classes/class.workflowallocation.php:114 -#: classes/class.workflowallocation.php:181 -msgid "Workflow doesn't exist" -msgstr "Workflow existiert nicht" - #: classes/class.workflowitems.php:281 msgid "Position in this workflow already exists." msgstr "Position existiert bereits in diesem Workflow." -#: classes/class.workflowallocation.php:106 -#: classes/class.workflowallocation.php:203 -msgid "Category already has a workflow assigned" -msgstr "Kategorie ist bereits Workflow zugeordnet" +#: classes/class.workflowusersequence.php:105 +msgid "Workflow item doesn't exist. Can't create entry." +msgstr "Workflow existiert nicht. Eintrag kann nicht erstellt werden." -#: classes/class.workflowallocation.php:212 -msgid "Category doesn't exist, assignment failed" -msgstr "Kategorie existiert nicht, Zuordnung fehlgeschlagen" +#: classes/class.workflowusersequence.php:212 +msgid "Can't set user_id: User or group doesn't exist" +msgstr "Kann Benutzer-Id nicht zuweisen: Benutzer oder Gruppe nicht vorhanden" -#: includes/include.workflow_tasks.php:124 -msgid "Show users" -msgstr "Zeige Benutzer" - -#: includes/include.workflow_tasks.php:132 -msgid "Search results" -msgstr "Suchergebnis" - -#: includes/include.workflow_tasks.php:132 -msgid "Workflow tasks" -msgstr "Workflow Aufgaben" - -#: includes/include.workflow_tasks.php:135 -msgid "Article" -msgstr "Artikel" - -#: includes/include.workflow_tasks.php:136 -msgid "Template" -msgstr "Template" - -#: includes/include.workflow_tasks.php:137 -#: includes/include.workflow_steps.php:297 -msgid "Actions" -msgstr "Aktionen" - -#: includes/include.workflow_tasks.php:138 -msgid "Title" -msgstr "Titel" - -#: includes/include.workflow_tasks.php:139 -msgid "Changed" -msgstr "Geändert" - -#: includes/include.workflow_tasks.php:140 -msgid "Published" -msgstr "Veröffentlichen" - -#: includes/include.workflow_tasks.php:141 includes/functions.workflow.php:730 -msgid "Workflow Step" -msgstr "Workflow Schritt" - -#: includes/include.workflow_tasks.php:142 includes/functions.workflow.php:731 -msgid "Workflow Action" -msgstr "Workflow Aktion" - -#: includes/include.workflow_tasks.php:143 includes/functions.workflow.php:732 -msgid "Workflow Editor" -msgstr "Workflow Bearbeiter" - -#: includes/include.workflow_tasks.php:144 includes/functions.workflow.php:733 -msgid "Last status" -msgstr "Letzter Status" - -#: includes/include.workflow_tasks.php:205 -msgid "Reminder" -msgstr "Wiedervorlage" - -#: includes/include.workflow_tasks.php:206 -msgid "Set reminder / add to todo list" -msgstr "Wiedervorlage / zur Todoliste hinzuf&uegen" - -#: includes/include.workflow_tasks.php:213 includes/functions.workflow.php:43 -#: includes/functions.workflow.php:311 includes/functions.workflow.php:611 -#: includes/functions.workflow.php:841 includes/functions.workflow.php:847 -msgid "None" -msgstr "Kein" - -#: includes/include.workflow_tasks.php:242 -msgid "No article found." -msgstr "Kein Artikel gefunden." - -#: includes/include.workflow_left_top.php:37 includes/config.plugin.php:39 -msgid "Create workflow" -msgstr "Neuer Workflow" - -#: includes/config.plugin.php:36 includes/include.workflow_list.php:69 +#: includes/config.plugin.php:36 includes/include.workflow_list.php:67 msgid "Delete workflow" msgstr "Workflow löschen" @@ -199,6 +124,10 @@ msgstr "Workflow-Aufgabe auswählen" msgid "Show workflow" msgstr "Workflow zeigen" +#: includes/config.plugin.php:39 includes/include.workflow_left_top.php:37 +msgid "Create workflow" +msgstr "Neuer Workflow" + #: includes/config.plugin.php:40 includes/include.workflow_edit.php:89 msgid "Edit workflow" msgstr "Workflow bearbeiten" @@ -212,7 +141,7 @@ msgstr "Workflow Schritt durchführen" msgid "Inherit workflow down" msgstr "Workflow nach unten vererben" -#: includes/config.plugin.php:44 includes/include.workflow_steps.php:289 +#: includes/config.plugin.php:44 includes/include.workflow_steps.php:286 msgid "Edit workflow step" msgstr "Workflow Schritt bearbeiten" @@ -256,6 +185,12 @@ msgstr "Workflowschrittbenutzer löschen" msgid "Associate workflow with category" msgstr "Workflow zu Kategorien zuweisen" +#: includes/functions.workflow.php:43 includes/functions.workflow.php:311 +#: includes/functions.workflow.php:611 includes/functions.workflow.php:841 +#: includes/functions.workflow.php:847 includes/include.workflow_tasks.php:211 +msgid "None" +msgstr "Kein" + #: includes/functions.workflow.php:154 msgid "Confirm" msgstr "Bestätigen" @@ -284,95 +219,21 @@ msgstr "Bestätigt" msgid "Workflow" msgstr "Workflow" -#: includes/include.workflow_steps.php:43 -#: includes/include.workflow_steps.php:385 -msgid "Add User" -msgstr "Benutzer hinzufügen" +#: includes/functions.workflow.php:730 includes/include.workflow_tasks.php:139 +msgid "Workflow Step" +msgstr "Workflow Schritt" -#: includes/include.workflow_steps.php:75 -msgid "New Workflow Step" -msgstr "Neuer Workflow Schritt" +#: includes/functions.workflow.php:731 includes/include.workflow_tasks.php:140 +msgid "Workflow Action" +msgstr "Workflow Aktion" -#: includes/include.workflow_steps.php:139 -msgid "Seconds" -msgstr "Sekunden" +#: includes/functions.workflow.php:732 includes/include.workflow_tasks.php:141 +msgid "Workflow Editor" +msgstr "Workflow Bearbeiter" -#: includes/include.workflow_steps.php:140 -msgid "Minutes" -msgstr "Minuten" - -#: includes/include.workflow_steps.php:141 -msgid "Hours" -msgstr "Stunden" - -#: includes/include.workflow_steps.php:142 -msgid "Days" -msgstr "Tage" - -#: includes/include.workflow_steps.php:143 -msgid "Weeks" -msgstr "Wochen" - -#: includes/include.workflow_steps.php:144 -msgid "Months" -msgstr "Monate" - -#: includes/include.workflow_steps.php:145 -msgid "Years" -msgstr "Jahre" - -#: includes/include.workflow_steps.php:194 -msgid "Move step up" -msgstr "Schritt nach oben bewegen" - -#: includes/include.workflow_steps.php:202 -msgid "Move step down" -msgstr "Schritt nach unten verschieben" - -#: includes/include.workflow_steps.php:212 -msgid "Delete step" -msgstr "Schritt löschen" - -#: includes/include.workflow_steps.php:254 -msgid "Create new step" -msgstr "Neuen Schritt erzeugen" - -#: includes/include.workflow_steps.php:290 -msgid "Step name" -msgstr "Name des Schritts" - -#: includes/include.workflow_steps.php:291 -msgid "Step description" -msgstr "Beschreibung des Schritts" - -#: includes/include.workflow_steps.php:298 -msgid "Assigned users" -msgstr "Zugeordnete Benutzer" - -#: includes/include.workflow_steps.php:326 -msgid "Move user up" -msgstr "Benutzer nach oben verschieben" - -#: includes/include.workflow_steps.php:335 -msgid "Move user down" -msgstr "Benutzer nach unten verschieben" - -#: includes/include.workflow_steps.php:346 -msgid "Delete user" -msgstr "Benutzer löschen" - -#: includes/include.workflow_steps.php:352 -msgid "Notify this user via E-Mail" -msgstr "Diesen Benutzer per e-Mail benachrichtigen" - -#: includes/include.workflow_steps.php:353 -msgid "Escalate to this user via E-Mail" -msgstr "An diesen Benutzer per e-Mail eskalieren" - -#: includes/include.workflow_list.php:70 -#, php-format -msgid "Do you really want to delete the following workflow:

%s
" -msgstr "Wollen Sie wirklich den folgenden Workflow löschen:

%s
" +#: includes/functions.workflow.php:733 includes/include.workflow_tasks.php:142 +msgid "Last status" +msgstr "Letzter Status" #: includes/include.workflow_edit.php:86 msgid "New Workflow" @@ -398,44 +259,141 @@ msgstr "Autor" msgid "Created" msgstr "Erstellt" -#~ msgid "Recently edited articles" -#~ msgstr "Zuletzt bearbeitete Artikel" +#: includes/include.workflow_list.php:68 +#, php-format +msgid "Do you really want to delete the following workflow:

%s
" +msgstr "Wollen Sie wirklich den folgenden Workflow löschen:

%s
" -#~ msgid "Change client" -#~ msgstr "Mandanten wechseln" +#: includes/include.workflow_steps.php:43 +#: includes/include.workflow_steps.php:381 +msgid "Add User" +msgstr "Benutzer hinzufügen" -#~ msgid "Welcome" -#~ msgstr "Willkommen" +#: includes/include.workflow_steps.php:75 +msgid "New Workflow Step" +msgstr "Neuer Workflow Schritt" -#~ msgid "You are logged in as" -#~ msgstr "Sie sind angemeldet als" +#: includes/include.workflow_steps.php:138 +msgid "Seconds" +msgstr "Sekunden" -#~ msgid "Last login" -#~ msgstr "Letzter Login" +#: includes/include.workflow_steps.php:139 +msgid "Minutes" +msgstr "Minuten" -#~ msgid "Article is online" -#~ msgstr "Artikel ist online" +#: includes/include.workflow_steps.php:140 +msgid "Hours" +msgstr "Stunden" -#~ msgid "Article is offline" -#~ msgstr "Artikel ist offline" +#: includes/include.workflow_steps.php:141 +msgid "Days" +msgstr "Tage" -#~ msgid "Current workflow tasks" -#~ msgstr "Aktuelle Workflow Aufgaben" +#: includes/include.workflow_steps.php:142 +msgid "Weeks" +msgstr "Wochen" -#~ msgid "Client" -#~ msgstr "Mandant" +#: includes/include.workflow_steps.php:143 +msgid "Months" +msgstr "Monate" -#~ msgid "Language" -#~ msgstr "Sprache" +#: includes/include.workflow_steps.php:144 +msgid "Years" +msgstr "Jahre" -#~ msgid "No tasks found" -#~ msgstr "Keine Aufgabe gefunden" +#: includes/include.workflow_steps.php:192 +msgid "Move step up" +msgstr "Schritt nach oben bewegen" -#~ msgid "Status" -#~ msgstr "Status" +#: includes/include.workflow_steps.php:200 +msgid "Move step down" +msgstr "Schritt nach unten verschieben" -#~ msgid "Step" -#~ msgstr "Schritt" +#: includes/include.workflow_steps.php:210 +msgid "Delete step" +msgstr "Schritt löschen" -#~ msgid "Assign workflow to category" -#~ msgstr "Workflow einer Kategorie zuordnen" +#: includes/include.workflow_steps.php:252 +msgid "Create new step" +msgstr "Neuen Schritt erzeugen" + +#: includes/include.workflow_steps.php:287 +msgid "Step name" +msgstr "Name des Schritts" + +#: includes/include.workflow_steps.php:288 +msgid "Step description" +msgstr "Beschreibung des Schritts" + +#: includes/include.workflow_steps.php:294 +#: includes/include.workflow_tasks.php:135 +msgid "Actions" +msgstr "Aktionen" + +#: includes/include.workflow_steps.php:295 +msgid "Assigned users" +msgstr "Zugeordnete Benutzer" + +#: includes/include.workflow_steps.php:323 +msgid "Move user up" +msgstr "Benutzer nach oben verschieben" + +#: includes/include.workflow_steps.php:332 +msgid "Move user down" +msgstr "Benutzer nach unten verschieben" + +#: includes/include.workflow_steps.php:343 +msgid "Delete user" +msgstr "Benutzer löschen" + +#: includes/include.workflow_steps.php:349 +msgid "Notify this user via E-Mail" +msgstr "Diesen Benutzer per e-Mail benachrichtigen" + +#: includes/include.workflow_steps.php:350 +msgid "Escalate to this user via E-Mail" +msgstr "An diesen Benutzer per e-Mail eskalieren" + +#: includes/include.workflow_tasks.php:122 +msgid "Show users" +msgstr "Zeige Benutzer" + +#: includes/include.workflow_tasks.php:130 +msgid "Search results" +msgstr "Suchergebnis" + +#: includes/include.workflow_tasks.php:130 +msgid "Workflow tasks" +msgstr "Workflow Aufgaben" + +#: includes/include.workflow_tasks.php:133 +msgid "Article" +msgstr "Artikel" + +#: includes/include.workflow_tasks.php:134 +msgid "Template" +msgstr "Template" + +#: includes/include.workflow_tasks.php:136 +msgid "Title" +msgstr "Titel" + +#: includes/include.workflow_tasks.php:137 +msgid "Changed" +msgstr "Geändert" + +#: includes/include.workflow_tasks.php:138 +msgid "Published" +msgstr "Veröffentlichen" + +#: includes/include.workflow_tasks.php:203 +msgid "Reminder" +msgstr "Wiedervorlage" + +#: includes/include.workflow_tasks.php:204 +msgid "Set reminder / add to todo list" +msgstr "Wiedervorlage / zur Todoliste hinzuf&uegen" + +#: includes/include.workflow_tasks.php:240 +msgid "No article found." +msgstr "Kein Artikel gefunden." diff --git a/templates/template.workflow_steps.html b/templates/template.workflow_steps.html index c77def0..a1fcc57 100644 --- a/templates/template.workflow_steps.html +++ b/templates/template.workflow_steps.html @@ -9,5 +9,5 @@ {EDITSTEP}
- i18n('Warning: Changes will reset active Workflows', 'cl-workflow') + i18n("Warning: Changes will reset active Workflows")
\ No newline at end of file