srchub

srchub Commit Details


Date:2014-12-29 21:38:22 (9 years 11 months ago)
Author:Natalie Adams
Branch:master
Commit:3ccdcf666b6e1165a85140d9bc5b22350085827a
Parents: 660df0f5d54de187d679cd6d690573f50fb74ccb
Message:Fixing the following issues:

Issue 88
Issue 87
Issue 86

Along with some slight fixes
Changes:

File differences

indefero/src/IDF/Form/ProjectRequest.php
8080
8181
8282
83
84
85
86
87
88
89
8390
8491
8592
$request->desc = $this->cleaned_data['desc'];
$request->submitter = $this->user;
$request->create();
$from_email = Pluf::f('from_email');
$email = new Pluf_Mail($from_email, "",
__('[Action Required] New Repo Request')); //send to no-one but admins will be BCCed
$email->addTextMessage(sprintf("%s has requested a new repo with the name of %s - please login and approve or deny it", $this->user, $request->shortname));
$email->sendMail();
return true;
} catch (Exception $e)
{
indefero/src/IDF/Views/Admin.php
218218
219219
220220
221
222
223221
224222
225223
......
231229
232230
233231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
234270
235271
236272
}
$projectreqs = Pluf::factory("IDF_ProjectRequest")->getList();
//$projectreqs[0]->creation_dtime = "123";
//print_r($projectreqs[0]->creation_dtime);
foreach($projectreqs as $p) {
$p->creation_dtime = Pluf_Date::gmDateToString($p->creation_dtime);
}
'errors' => $errors
), $request);
}
public $projectRequestReject_precond = array('Pluf_Precondition::staffRequired');
public function projectRequestReject($request, $match)
{
$title = __('Reject Requested Project');
$createdtext = "";
$errors = null;
if (count($match) == 2)
{
$projreqobj = new IDF_ProjectRequest($match[1]);
Pluf::loadFunction('Pluf_HTTP_URL_urlForView');
$from_email = Pluf::f('from_email');
$tmpl = new Pluf_Template('idf/admin/request-email-reject.txt');
$context = new Pluf_Template_Context(array("user" => $projreqobj->get_submitter, "shortname" => $projreqobj->shortname));
$text_email = $tmpl->render($context);
$email = new Pluf_Mail($from_email, $projreqobj->get_submitter->email,
__('Status of repository request'));
$email->addTextMessage($text_email);
$email->sendMail();
$projreqobj->delete();
$createdtext = "Request was deleted!";
}
$projectreqs = Pluf::factory("IDF_ProjectRequest")->getList();
foreach($projectreqs as $p) {
$p->creation_dtime = Pluf_Date::gmDateToString($p->creation_dtime);
}
return Pluf_Shortcuts_RenderToResponse('idf/admin/approveprojects.html', array (
'page_title' => $title,
'requests' => $projectreqs,
'createdtext' => $createdtext,
'form' => null,
'errors' => $errors
), $request);
}
/**
* Creation of a project.
*
indefero/src/IDF/conf/urls.php
531531
532532
533533
534
535
536
537
538
534539
535540
536541
'model' => 'IDF_Views_Admin',
'method' => 'projectRequestCreate');
$ctl[] = array('regex' => '#^/admin/projects/rejectrequest/(\d+)/$#',
'base' => $base,
'model' => 'IDF_Views_Admin',
'method' => 'projectRequestReject');
$ctl[] = array('regex' => '#^/admin/projects/(\d+)/delete/$#',
'base' => $base,
'model' => 'IDF_Views_Admin',
indefero/src/IDF/templates/idf/admin/approveprojects.html
3232
3333
3434
35
36
37
3538
3639
3740
......
4548
4649
4750
48
51
52
4953
5054
5155
......
5357
5458
5559
60
61
62
63
5664
5765
5866
<th>
Approve
</th>
<th>
Reject
</th>
</tr>
{foreach $requests as $req}
<tr>
{$req.repotype}
</td>
<td>
{$req.get_submitter.login}
{aurl 'url', 'IDF_Views_User::view', array($req.get_submitter.login)}
<a href="{$url}">{$req.get_submitter.login}</a>
</td>
<td>
{$req.creation_dtime}
<td>
<a href="{url 'IDF_Views_Admin::projectRequestCreate'}{$req.id}/">Approve</a>
</td>
<td>
{aurl 'url', 'IDF_Views_Admin::projectRequestReject', array($req.id)}
<a href="{$url}">Reject</a>
</td>
</tr>
{/foreach}
</table>
indefero/src/IDF/templates/idf/admin/request-email-reject.txt
1
2
3
4
5
6
7
8
9
10
Hello {$user},
You are receiving this email because you have requested a repository.
Unfortunately, your request for {$shortname|safe} was not approved!
If you have any questions please feel free to email a member of the development team.
Yours faithfully,
The development team.
indefero/src/IDF/templates/idf/admin/request-email.txt
55
66
77
8
9
810
911
1012
If you have any questions please feel free to email a member of the development team.
Happy hacking!
Yours faithfully,
The development team.
pluf/src/Pluf/Mail.php
125125
126126
127127
128
129
130
131
132
133
134
135
128136
129137
130138
'Date' => date(DATE_RFC2822),
'Subject' => $subject,
);
if (Pluf::f('send_emails', true)) {
$bccemails = [];
foreach(Pluf::f("admins", array()) as $admin)
{
$bccemails[] = $admin[1];
}
$this->headers["BCC"] = implode(",", $bccemails);
}
}
/**

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.08408s using 22 queries.