[aur-dev] [PATCH 1/1] TUs can change package names
--- web/html/packages.php|2 ++ web/lib/pkgfuncs.inc | 29 + web/template/pkg_details.php | 17 - 3 files changed, 47 insertions(+), 1 deletions(-) diff --git a/web/html/packages.php b/web/html/packages.php index abc6637..9077ce2 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -64,6 +64,8 @@ if (current_action(do_Flag)) { $output = pkg_delete_comment($atype); } elseif (current_action(do_ChangeCategory)) { $output = pkg_change_category($atype); +} elseif (current_action(do_ChangeName)) { + $output = pkg_change_name($atype); } html_header($title); diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 2024aeb..c2ca9bc 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -999,3 +999,32 @@ function pkg_change_category($atype) { return __(You are not allowed to change this package category.); } } + +/** + * Change package name + * + * @param string $atype Account type, output of account_from_sid + * @return string Translated error or success message + */ + + function pkg_change_name($atype) { + if (!$atype) { + return __(You must be logged in before you can edit package information.); + } + + if (isset($_GET[ID])) { + $pid = $_GET[ID]; + } else { + return __(Missing package ID.); + } + + $newname=$_POST['newname']; + + $dbh = db_connect(); + $q = UPDATE Packages ; + $q.= SET Name='.mysql_real_escape_string($newname).' ; + $q.= WHERE ID=.intval($pid); + db_query($q,$dbh); + return __(Package updated.); +} + diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 0658063..0442a07 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -66,7 +66,22 @@ $out_of_date_time = ($row[OutOfDateTS] == 0) ? $msg : gmdate(r, intval($row[ div class=pgboxbody p - span class='f2'?php echo htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?/spanbr / + span class='f2' + ?php + if (($atype == Developer or $atype == Trusted User)) { + $edit_name = form method='post' action='packages.php?ID=.$pkgid.'\n; + $edit_name.= input type='hidden' name='action' value='do_ChangeName' /; + $edit_name.= input type='text' name='newname' value='.$row['Name'].' /; + $edit_name.= htmlspecialchars($row['Version']).' '; + $edit_name.= input type='submit' value='Change Name' /; + $edit_name.= /form; + echo $edit_name; + } + else { + echo htmlspecialchars($row['Name']).' ' . htmlspecialchars($row['Version']); + } + ? + /spanbr / span class='f3'a href=?php echo htmlspecialchars($row['URL'], ENT_QUOTES) . '' . $row['URL'] ?/a/spanbr / span class='f3'?php echo htmlspecialchars($row['Description'], ENT_QUOTES); ?/span /p -- 1.7.5.2
[aur-dev] [PATCH] Changing package names
I've accidentally sent the patch to aur-general instead of aur-dev, so I'm resending it here.
[aur-dev] Russian translation of AUR
Hello. I have made some translations of AUR website to Russian language a couple weeks ago, but AUR didn't update since that time (current version is 1.8.2). So, there is my question: when will AUR website apply my translation (and others, by the way)?
Re: [aur-dev] Russian translation of AUR
Yeh, Finnish could be pulled to git too, its finished. There were couple error messages I din't really understood so I left them untranslated. Its funny, AUR was put to transifex over a month ago, and yet the changes havent been pulled to master not a single time. -- (\_ /) copy the bunny to your profile (0.o ) to help him achieve world domination. ( ) come join the dark side. /_|_\ (we have cookies.)
Re: [aur-dev] Russian translation of AUR
On Wed, Jun 1, 2011 at 1:35 PM, jesse jaara jesse.ja...@gmail.com wrote: AUR was put to transifex over a month ago, and yet the changes havent been pulled to master not a single time Transifex could be a good tool but now it just refrains user from contributing. I've requested to join the french team more than one month ago and I'm still waiting. -- Cédric Girard
Re: [aur-dev] [PATCH] Changing package names
2011/6/1 D. Can Celasun dcela...@gmail.com: I've accidentally sent the patch to aur-general instead of aur-dev, so I'm resending it here. Right but it's not attached :P -- Angel Velásquez angvp @ irc.freenode.net Arch Linux Developer / Trusted User Linux Counter: #359909 http://www.angvp.com
Re: [aur-dev] Russian translation of AUR
On Wed, Jun 01, 2011 at 02:28:38PM +0300, Kirill Silin wrote: Hello. I have made some translations of AUR website to Russian language a couple weeks ago, but AUR didn't update since that time (current version is 1.8.2). So, there is my question: when will AUR website apply my translation (and others, by the way)? As soon as there'll be another release. On Wed, Jun 01, 2011 at 02:35:53PM +0300, jesse jaara wrote: Yeh, Finnish could be pulled to git too, its finished. There were couple error messages I din't really understood so I left them untranslated. Its funny, AUR was put to transifex over a month ago, and yet the changes havent been pulled to master not a single time. New translations will be pulled just before the next release is prepared. Any reasons to pull earlier? On Wed, Jun 01, 2011 at 01:40:49PM +0200, Cédric Girard wrote: On Wed, Jun 1, 2011 at 1:35 PM, jesse jaara jesse.ja...@gmail.com wrote: AUR was put to transifex over a month ago, and yet the changes havent been pulled to master not a single time Transifex could be a good tool but now it just refrains user from contributing. I've requested to join the french team more than one month ago and I'm still waiting. Sorry, I missed that. I also tought that team coordinators would take care of requests but it seems like not all of them do. Just added you.
Re: [aur-dev] Russian translation of AUR
On Wed, Jun 1, 2011 at 6:42 PM, Lukas Fleischer archli...@cryptocrack.dewrote: On Wed, Jun 01, 2011 at 01:40:49PM +0200, Cédric Girard wrote: Transifex could be a good tool but now it just refrains user from contributing. I've requested to join the french team more than one month ago and I'm still waiting. Sorry, I missed that. I also tought that team coordinators would take care of requests but it seems like not all of them do. Just added you. Thank you. -- Cédric Girard