Merge branch 'master' of

ssh://gitolite@asdynamics.com:50005/projects/fdn2.git

Conflicts:
	private/lib/gui/DatatablesHelper.php
This commit is contained in:
Riccardo Di Dato
2016-01-20 15:14:58 +01:00
3 changed files with 29 additions and 27 deletions
+2 -2
View File
@@ -52,8 +52,8 @@ class DatatablesHelper {
$rval->$key = self::getObjectFromFieldsArray($obj->$key, $val);
}
else {
if ($val instanceof MongoDate){
$obj->$key = date("d-m-Y",$rval->$key->sec);
if ($obj->$key instanceof MongoDate){
$rval->$key = date("d-m-Y",$obj->$key->sec);
}
else {
$rval->$key = $obj->$key;
+26 -24
View File
@@ -22,7 +22,6 @@ if(!is_null($notiziaId)){
$edit = true;
$notizia = GlobalVariables::get("dao")->getFirst("NotiziaModel",array("id"=>$notiziaId));
// echo "pene";
// var_dump($notizia);
if(is_null($notizia)){
GUIHandler::redirect("admin/myNotizie.php");
}
@@ -41,36 +40,39 @@ HTMLHelper::generateAdminHead();
if(!is_null(PostHandler::get("action")) && strcmp(PostHandler::get("action"), "")!=0){
$save = PostHandler::get("action");
if(strcmp($save, "save")==0){
$saveable = new stdClass();
$saveable->id = PostHandler::get("id");
$saveable->titolo = PostHandler::get("titolo");
$saveable->sottotitolo = PostHandler::get("sottotitolo");
$saveable->testo = PostHandler::get("testo");
$mongoDate = new MongoDate(PostHandler::get("date")->getTimeStamp());
$saveable->about->date = $mongoDate;
$notizia->titolo = PostHandler::get("titolo");
$notizia->sottotitolo = PostHandler::get("sottotitolo");
$notizia->testo = PostHandler::get("testo");
$mongoDate = new MongoDate(strtotime(PostHandler::get("data")));
// $mongoDate = new DateTime('2013-09-22T10:41:44.451999');
// $seconds = $mongoDate->getTimestamp();
// $microseconds = $mongoDate->format("u");
$notizia->about->data = $mongoDate;
if(!$edit){
$saveable->about->author = AdminLoginManager::getLogged()->nome." ".AdminLoginManager::getLogged()->nome;
$saveable->about->owner = AdminLoginManager::getLogged()->id;
}
else{
$saveable->about->author = PostHandler::get("nome")." ".PostHandler::get("cognome");
$saveable->about->owner = PostHandler::get("owner");
$notizia->about->author = AdminLoginManager::getLogged()->nome." ".AdminLoginManager::getLogged()->nome;
$notizia->about->owner = AdminLoginManager::getLogged()->id;
}
GlobalVariables::get("dao")->save($saveable);
}
GlobalVariables::get("dao")->save($notizia);
GUIHandler::redirect("admin/listNotizie.php");
}
else{
echo "non salvo";
}
}
else{
echo "post nullo";
}
?>
<div>
<form action="" method="POST" id="notiziaForm">
<input type="hidden" value="<?php echo $notiziaId;?>" name="id"/>
<input type="hidden" value="<?php echo $notizia->about->nome;?>" name="nome"/>
<input type="hidden" value="<?php echo $notizia->about->cognome;?>" name="cognome"/>
<input type="hidden" value="<?php echo $notizia->about->owner;?>" name="owner"/>
<div><?php
var_dump($notizia->about->data);?>
<form method="POST" id="notiziaForm">
<input type="hidden" value="<?php echo $notiziaId;?>" name="id"/>
<div style="padding:10px;">
<div style="padding:5px; display:inline-block;">Titolo:
<textarea name="titolo" rows="2" cols="30" style="resize:none;"><?php echo $notizia->titolo;?></textarea>
@@ -80,7 +82,7 @@ if(!is_null(PostHandler::get("action")) && strcmp(PostHandler::get("action"), ""
</div>
</div>
<textarea name="testo" id="editore_testo" rows="10" cols="80"><?php echo $notizia->testo;?></textarea>
<div>Data: <input type="text" id="datepicker" name="date" value="<?php echo $notizia->about->date;?>"></div>
<div>Data: <input type="text" id="datepicker" name="data" value="<?php echo date("d-m-Y",$notizia->about->data->sec);?>"></div>
<input type="hidden" name="action" value=""/>
</form>
@@ -41,7 +41,7 @@ $permissionFlagRequired = AdminModel::ADMIN_TYPE_EDITORE_SUPERVISOR;
$exposedFields = array(
"titolo"=>null,
"sottotitolo"=>null,
"about"=>null,
"about"=>array("data"=>null,"author"=>null),
"id"=>null
);