Commit 28b528e9 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweak

parent a781e0f8
......@@ -7,24 +7,62 @@ class Form {
const ICON = "fa-list-alt";
const ICON_ANSWER = "fa-calendar-check-o";
public static $riskWeight = array(
"11" => array( "w" => 1 , "c" => "lightGreen"),
"12" => array( "w" => 2 , "c" => "lightGreen"),
"13" => array( "w" => 3 , "c" => "lightGreen"),
"14" => array( "w" => 4 , "c" => "orange"),
"21" => array( "w" => 5 , "c" => "lightGreen"),
"22" => array( "w" => 6 , "c" => "lightGreen"),
"23" => array( "w" => 7 , "c" => "orange"),
"24" => array( "w" => 8 , "c" => "red"),
"31" => array( "w" => 9 , "c" => "lightGreen"),
"32" => array( "w" => 10 , "c" => "orange"),
"33" => array( "w" => 11 , "c" => "red"),
"34" => array( "w" => 12 , "c" => "red"),
"41" => array( "w" => 13 , "c" => "orange"),
"42" => array( "w" => 14 , "c" => "red"),
"43" => array( "w" => 15 , "c" => "red"),
"44" => array( "w" => 16 , "c" => "red")
);
const TYPE_OPENFORM = "openForm";
public static $riskWeight = [
"11" => [ "w" => 1 , "c" => "lightGreen"],
"12" => [ "w" => 2 , "c" => "lightGreen"],
"13" => [ "w" => 3 , "c" => "lightGreen"],
"14" => [ "w" => 4 , "c" => "orange"],
"21" => [ "w" => 5 , "c" => "lightGreen"],
"22" => [ "w" => 6 , "c" => "lightGreen"],
"23" => [ "w" => 7 , "c" => "orange"],
"24" => [ "w" => 8 , "c" => "red"],
"31" => [ "w" => 9 , "c" => "lightGreen"],
"32" => [ "w" => 10 , "c" => "orange"],
"33" => [ "w" => 11 , "c" => "red"],
"34" => [ "w" => 12 , "c" => "red"],
"41" => [ "w" => 13 , "c" => "orange"],
"42" => [ "w" => 14 , "c" => "red"],
"43" => [ "w" => 15 , "c" => "red"],
"44" => [ "w" => 16 , "c" => "red"],
];
public static $inputTypes = [
"text" => "Text : petit text court",
"textarea" => "Textarea : Grande zone de texte",
//"button" => "button",
"tpls.forms.checkbox" => "checkbox : Case à cocher",
"color" => "color : Selectionner une couleur",
"date" => "date : Selectionner une date",
"datetime-local" => "datetime-local : Selectionner une date et heure",
"month" => "Choisir un mois",
"week" => "week : Choisir un semaine",
"time" => "time : Ajouter une heure",
"email" => "Remplir un email",
//"image" => "Ajouter une image",
"number" => "Choisir un nombre",
"radio" => "radio : Choix unique",
//"range" => "range : ",
"tel" => "tel : Ajouter un Telephone",
"url" => "url : Ajouter un lien internet",
"tags" => "tags : Ajouter des tags",
"tpls.forms.select" =>"select : ajouter une liste de choix",
"tpls.forms.cplx.calendar" =>"liste d'actions clefs avec des dates",
"tpls.forms.cplx.partner" =>"Les partenaires et leurs engagements réciproques",
"tpls.forms.cplx.budget" => "Liste de dépense",
"tpls.forms.cplx.financement" =>"Liste de Financement",
"tpls.forms.cplx.financementFromBudget" =>"Liste de Financement réutilisant les budgets",
"tpls.forms.cplx.indicateurs" =>"Liste d'Indicateur",
"tpls.forms.cplx.element" =>"Créer un élément Person , Organisation, Projet,...",
"tpls.forms.cplx.stepValidation" =>"Step Validation by Roles",
"tpls.forms.cplx.generatePDF" =>"Generate PDF",
"tpls.forms.cplx.address" =>"Geocode an address",
"tpls.forms.cplx.regle" =>"règle d'attribution",
"tpls.forms.cplx.multiCheckbox" =>"Liste of checkboxes",
"sectionTitle" => "Séparateur de Section avec Titre",
];
public static function newAnswer($data)
{
......@@ -557,7 +595,32 @@ class Form {
return $res;
}
public static function generateOpenForm($slug){
$forms = PHDB::find(self::COLLECTION, ["parentSlug"=> $slug] );
$create = false;
if( count( $forms ) == 0 )
$create = true;
else {
foreach ($forms as $i => $f) {
if( !isset($f["inputs"]) )
return $f["id"];
}
$create = true;
}
if($create)
{
$form = [
"id" => $slug.count( $forms ),
"parentSlug" => $slug,
"type" => "openForm"
];
$f = PHDB::insert( Form::COLLECTION, $form );
return $slug.count( $forms );
}
}
}
?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment