Skip to content

Commit

Permalink
Merge remote branch 'gsolt/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
David Soria Parra committed Nov 22, 2010
2 parents 3ddf3f3 + 359f6e5 commit b66b43e
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 8 deletions.
2 changes: 1 addition & 1 deletion phprojekt/INSTALL
Expand Up @@ -92,7 +92,7 @@ B. License
command. Assuming your webserver runs on the group "www-data":

UNIX
$ chmod -R 0750 /srv/www
$ chmod -R 0755 /srv/www
$ chgrp -R www-data /srv/www
$ mkdir /srv/private/phprojekt
$ chmod -R 0770 /srv/private/phprojekt/
Expand Down
Expand Up @@ -37,7 +37,7 @@ dojo.declare("phpr.Module.Designer", dojo.dnd.AutoSource, {

// Open the edit form
var t = this._normalizedCreator(nodes[0]);
if (dojo.isIE) {
if (dojo.isIE || (dojo.isChrome && dojo.isChrome == 7)) {
dojo.style(t.node.childNodes[0].childNodes[1].childNodes[0].childNodes[2], 'display', 'inline');
} else {
dojo.style(t.node.childNodes[0].childNodes[3].childNodes[0].childNodes[2], 'display', 'inline');
Expand Down
4 changes: 2 additions & 2 deletions phprojekt/application/Default/Helpers/Upload.php
Expand Up @@ -107,7 +107,7 @@ static public function uploadFile($model, $field, $itemId)
}
// Fix name for save it as md5
if (is_array($_FILES) && !empty($_FILES) && isset($_FILES['uploadedFile'])) {
$md5name = md5(mt_rand());
$md5name = md5(mt_rand() . time());
$addedValue = $md5name . '|' . $_FILES['uploadedFile']['name'];
$_FILES['uploadedFile']['name'] = $md5name;
}
Expand Down Expand Up @@ -173,7 +173,7 @@ static public function downloadFile($model, $field, $itemId, $order)
$md5Name = '';
$fileName = '';
if (isset($files[$order - 1])) {
list($md5Name, $fileName) = explode("|", $files[$order - 1]);
list($md5Name, $fileName) = explode("|", $files[$order - 1], 2);
}

if (!empty($fileName) && preg_match("/^[A-Fa-f0-9]{32,32}$/", $md5Name)) {
Expand Down
2 changes: 2 additions & 0 deletions phprojekt/application/Default/Languages/de.inc.php
Expand Up @@ -124,6 +124,8 @@
$lang["Are you sure you want to delete?"] = "Sind sie sicher, die sie löschen möchten?";
$lang["Please confirm implement"] = "Bitte bestätigen sie implementieren";
$lang["rows selected"] = "zeilen ausgewählt";
$lang["Period"] = "Zeitraum";
$lang["End date can not be before Start date"] = "Das Start-Datum muss vor dem End-Datum liegen";

// Error handler messages
$lang["Run-time notice. The script encountered something that could indicate an error, but could also happen in the "
Expand Down
2 changes: 2 additions & 0 deletions phprojekt/application/Default/Languages/en.inc.php
Expand Up @@ -121,6 +121,8 @@
$lang["Are you sure you want to delete?"] = "Are you sure you want to delete?";
$lang["Please confirm implement"] = "Please confirm implement";
$lang["rows selected"] = "rows selected";
$lang["Period"] = "Period";
$lang["End date can not be before Start date"] = "End date can not be before Start date";

// Error handler messages
$lang["Run-time notice. The script encountered something that could indicate an error, but could also happen in the "
Expand Down
2 changes: 2 additions & 0 deletions phprojekt/application/Default/Languages/es.inc.php
Expand Up @@ -121,6 +121,8 @@
$lang["Are you sure you want to delete?"] = "¿Está seguro que desea eliminar?";
$lang["Please confirm implement"] = "Por favor, confirme aplicar";
$lang["rows selected"] = "filas seleccionadas";
$lang["Period"] = "Período";
$lang["End date can not be before Start date"] = "La Fecha de fin no puede ser anterior a la Fecha de comienzo";

// Error handler messages
$lang["Run-time notice. The script encountered something that could indicate an error, but could also happen in the "
Expand Down
14 changes: 14 additions & 0 deletions phprojekt/application/Project/Models/Project.php
Expand Up @@ -230,4 +230,18 @@ public function saveRights($rights)
$rightNamespace->unsetAll();
}
}

/**
* Validate the data of the current record.
*
* @return boolean True for valid.
*/
public function recordValidate()
{
if (!$this->_validate->validateDateRange($this->startDate, $this->endDate)) {
return false;
} else {
return parent::recordValidate();
}
}
}
14 changes: 14 additions & 0 deletions phprojekt/application/Todo/Models/Todo.php
Expand Up @@ -49,4 +49,18 @@ public function getNotification()

return $notification;
}

/**
* Validate the data of the current record.
*
* @return boolean True for valid.
*/
public function recordValidate()
{
if (!$this->_validate->validateDateRange($this->startDate, $this->endDate)) {
return false;
} else {
return parent::recordValidate();
}
}
}
6 changes: 3 additions & 3 deletions phprojekt/htdocs/Setup/Models/Setup.php
Expand Up @@ -578,11 +578,11 @@ public function finish()
// Set access
$baseDir = str_replace('htdocs/setup.php', '', $_SERVER['SCRIPT_FILENAME']);
if (PHP_OS == 'WIN32' || PHP_OS == 'WINNT') {
$this->_error[] = '"' . $baseDir . '" should have the next rights: 0750 for folders, 0640 for files';
$this->_error[] = '"' . $baseDir . '" should have the next rights: 0755 for folders, 0644 for files';
} else {
// Root
if (!$this->chmodRecursive($baseDir, 0750, 0640)) {
$this->_error[] = '"' . $baseDir . '" should have the next rights: 0750 for folders, 0640 for files';
if (!$this->chmodRecursive($baseDir, 0755, 0644)) {
$this->_error[] = '"' . $baseDir . '" should have the next rights: 0755 for folders, 0644 for files';
}
}

Expand Down
3 changes: 2 additions & 1 deletion phprojekt/htdocs/Setup/Views/dojo/server.phtml
@@ -1,7 +1,8 @@
<div class="prepend-0">
<h2>Step 1 - Check the Server</h2>
Welcome to PHProjekt 6!<br />
This wizard will help you to create one and install all the nesesaries tables.
This wizard will help you to create one and install all the nesesaries tables.<br />
<b>NOTE: Your browser must accept cookies to run the setup.</b>
<br />
<br />

Expand Down
23 changes: 23 additions & 0 deletions phprojekt/library/Phprojekt/Model/Validate.php
Expand Up @@ -228,4 +228,27 @@ public function validateIsRequired($value)

return $error;
}

/**
* Validate that $start is before $end.
*
* @param string $start Start date value.
* @param string $end End date value.
*
* @return boolean True for valid.
*/
public function validateDateRange($start, $end)
{
if (!empty($start) && !empty($end)) {
if (strtotime($start) > strtotime($end)) {
$this->error->addError(array(
'field' => "Period",
'label' => Phprojekt::getInstance()->translate('Period'),
'message' => Phprojekt::getInstance()->translate('End date can not be before Start date')));
return false;
}
}

return true;
}
}

0 comments on commit b66b43e

Please sign in to comment.