Пример #1
0
 /**
  * testContratDelete
  *
  * @param	int		$id		Id of contract
  * @return	int
  *
  * @depends	testContratOther
  * The depends says test is run only if previous is ok
  */
 public function testContratDelete($id)
 {
     global $conf, $user, $langs, $db;
     $conf = $this->savconf;
     $user = $this->savuser;
     $langs = $this->savlangs;
     $db = $this->savdb;
     $localobject = new Contrat($this->savdb);
     $result = $localobject->fetch($id);
     $result = $localobject->delete($user);
     print __METHOD__ . " id=" . $id . " result=" . $result . "\n";
     $this->assertLessThan($result, 0);
     return $result;
 }
Пример #2
0
    $result = $object->validate($user,$langs,$conf);
}

// Close all lines
if ($action == 'confirm_close' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
{
    $object->fetch($_GET["id"]);
    $result = $object->cloture($user,$langs,$conf);
}

if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes')
{
    if ($user->rights->contrat->supprimer)
    {
        $object->id = $_GET["id"];
        $result=$object->delete($user,$langs,$conf);
        if ($result >= 0)
		{
			Header("Location: index.php");
			return;
		}
		else
		{
			$mesg='<div class="error">'.$object->error.'</div>';
		}
    }
}

if ($action == 'confirm_move' && $_REQUEST["confirm"] == 'yes')
{
    if ($user->rights->contrat->creer)