Example #1
0
    //print '<td>'.$formmandat->select_mandat('','mandat','',1,1,0).'</td></tr>';
    print '</table>';
    print '</div>';
    print '<table style=noborder align="right">';
    print '<tr><td align="center" colspan=2>';
    print '<input type="submit" name="importadress" class="butAction" value="' . $langs->trans("Save") . '"> &nbsp; ';
    print '<input type="submit" name="cancel" class="butActionDelete" value="' . $langs->trans("Cancel") . '">';
    print '</td></tr>';
    print '</table>';
    print '</form>';
} else {
    // Affichage de la fiche des mandat gere
    if ($id) {
        print_barre_liste($langs->trans("Gestion des Bien Immobilier"), "", "", "", "", "", '', 0);
        $agf = new Mandat($db);
        $result = $agf->fetch($id);
        if ($result) {
            $head = mandat_prepare_head($agf);
            dol_fiche_head($head, 'fiche', $langs->trans("Gestion des Mandats"), 0, 'contrat');
            // reference propio
            $soc = new Societe($db);
            $soc->fetch($agf->fk_soc);
            // Affichage en mode "édition"
            if ($action == 'edit') {
                $formcompany = new FormCompany($db);
                // TODO
                $formimmo = new FormImmobilier($db);
                print_barre_liste($langs->trans("Modification Mandat"), "", "", "", "", "", '', 0);
                // debut formulaire mis a jours mandat
                print '<form name="update" action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n";
                print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n";
Example #2
0
 $var = !$var;
 print "<tr {$bc[$var]}>";
 //print '<td>';
 $biensstatic->id = $objp->rowid;
 $biensstatic->ref = $objp->adresse;
 $biensstatic->type = $objp->loyer;
 $bienstatic->fk_mandat = $objp->fk_mandat;
 //print $biensstatic->getNomUrl(1,'supplier');
 //Print $objp->rowid;
 //print '<a href="fiche.php?id='.$objp->rowid.'">';
 //print img_object($langs->trans("ShowContract"),"contract").' '.(isset($objp->rowid) ? $objp->rowid : $obj->cid) .'</a>';
 //print '</td>';
 print "<td> <a href=\"fiche.php?id={$objp->rowid}\">{$objp->ref}</a></td>";
 //   print '<td>'.$objp->ref.'</td>'."\n";
 $supplier = new Mandat($db);
 $supplier->fetch($objp->fk_mandat);
 if ($objp->fk_mandat > 0) {
     $titre = $supplier->getmandatUrl(1) . $titre . $supplier->ref_interne . " </br>du :  " . dol_print_date($supplier->date_contrat);
 } else {
     $titre = "Pas de Mandat de location";
 }
 print '<td>' . $titre . '</td>';
 print '<td>' . $objp->adresse . '</td>';
 print '<td>' . $objp->town . '</td>';
 print '<td> Type ' . $objp->nb_piece . '</td>' . "\n";
 //$companystatic->nom=$objp->nom;
 //$companystatic->id=$objp->socid;
 //print '<td>'.$companystatic->getNomUrl(1,'supplier').'</td>';
 //print '<td align="right">'.price($objp->loyer).'</td>';
 //	print '<td align="right">'.$objp->qty.'</td>';
 //print '<td align="right">'.price($objp->unitprice).'</td>';
Example #3
0
 /**
  *	Load an object from its id and create a new one in database
  *
  *	@param	int		$fromid     Id of object to clone
  * 	@return	int					New id of clone
  */
 function createFromClone($fromid)
 {
     global $user, $langs;
     $error = 0;
     $object = new Mandat($this->db);
     $this->db->begin();
     // Load source object
     $object->fetch($fromid);
     $object->id = 0;
     $object->statut = 0;
     // Clear fields
     // ...
     // Create clone
     $result = $object->create($user);
     // Other options
     if ($result < 0) {
         $this->error = $object->error;
         $error++;
     }
     if (!$error) {
     }
     // End
     if (!$error) {
         $this->db->commit();
         return $object->id;
     } else {
         $this->db->rollback();
         return -1;
     }
 }
Example #4
0
$datecontrat = '';
// Security check
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'contrat', $id);
$usehm = !empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE : 0;
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('contractcard'));
$object = new Mandat($db);
/*
 * Actions
 */
// Activation du mandats apres creation
if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) {
    $object->fetch($id);
    $result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment'));
    if ($result > 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
        exit;
    } else {
        $mesg = $object->error;
    }
} else {
    if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) {
        $object->fetch($id);
        $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
        if ($result > 0) {
            header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
            exit;
        } else {
Example #5
0
                 
                 if ($action=='archive' || $action=='active')
                 {
                     if ($action == 'archive') $value=1;
                     if ($action == 'active') $value=0;
 
                     $ret=$form->form_confirm($_SERVER['PHP_SELF']."?arch=".$value."&id=".$id,$langs->trans("AgfFormationArchiveChange"),$langs->trans("AgfConfirmArchiveChange"),"arch_confirm_delete",'','',1);
                     if ($ret == 'html') print '<br>';
                 }
 */
 $showphoto = $agf->is_photo_available($conf->gestimmo->multidir_output[$agf->entity]);
 $formmandat = new Formgestimmo($db);
 $titre = "  MANDAT :  ";
 // affichage du mandat/propio
 $supplier = new Mandat($db);
 $supplier->fetch($agf->fk_mandat);
 $titre = $supplier->getmandatUrl(1) . $titre . $supplier->ref_interne . " du :  " . dol_print_date($supplier->date_contrat);
 //   print $supplier->getmandatUrl(1);
 // print '<tr><td>'.$supplier->rowid.'</td>';
 // print '<input  name="ref_mandat" value="'.$ref_interne.'">';
 //print '<td>'.$supplier->ref_interne.'</tr></td>';
 //print '</tr></table>'   ;
 //
 if ($showphoto) {
     print '<td valign="middle" align="center" width="25%" rowspan="' . $nblignes . '">';
     print $agf->show_photos($conf->gestimmo->multidir_output[$agf->entity], 1, 1, 0, 0, 0, 80);
     print '</td>';
 }
 print_titre($titre);
 print "</table>";
 print '<table class="border" width="100%">';
Example #6
0
                //pour gere le retour en cas d erreur
                $action = 'edit';
            }
        }
    }
}
/*
 * Action create (fiche bails immo)
*/
if ($action == 'create_confirm') {
    if (!$_POST["cancel"]) {
        $gestimmo = new Bails($db);
        // Pour rensegner les valeurs du bails
        $staticmandat = new Mandat($db);
        $idmandat = GETPOST('fk_mandat');
        $staticresult = $staticmandat->fetch($idmandat);
        //  print $staticmandat->id;
        // todo champs pour la creation du bail
        $gestimmo->fk_prop = $staticmandat->fk_soc;
        $gestimmo->fk_loc = GETPOST('fk_loc', 'int');
        $gestimmo->fk_logement = $staticmandat->fk_biens;
        $gestimmo->fk_mandat = GETPOST('fk_mandat', 'int');
        $gestimmo->Type = GETPOST('Type', 'alpha');
        $gestimmo->Date_location = GETPOST('Date_location', 'alpha');
        $gestimmo->Depot_garantie = GETPOST('Depot_garantie', 'alpha');
        $gestimmo->date_fin = GETPOST('date_fin', 'alpha');
        $gestimmo->entity = getpost('entity');
        $result = $gestimmo->create($user);
        if ($result > 0) {
            if ($url_return) {
                Header("Location: " . $url_return);